chore: remove unused logger
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getVoidLogger } from '../logging';
|
||||
import { UrlReaderPredicateMux } from './UrlReaderPredicateMux';
|
||||
|
||||
describe('UrlReaderPredicateMux', () => {
|
||||
@@ -32,7 +31,7 @@ describe('UrlReaderPredicateMux', () => {
|
||||
search: jest.fn(),
|
||||
};
|
||||
|
||||
const mux = new UrlReaderPredicateMux(getVoidLogger());
|
||||
const mux = new UrlReaderPredicateMux();
|
||||
mux.register({
|
||||
predicate: url => url.hostname === 'foo',
|
||||
reader: fooReader,
|
||||
@@ -62,7 +61,7 @@ describe('UrlReaderPredicateMux', () => {
|
||||
});
|
||||
|
||||
it('throws an error if no predicate matches', async () => {
|
||||
const mux = new UrlReaderPredicateMux(getVoidLogger());
|
||||
const mux = new UrlReaderPredicateMux();
|
||||
|
||||
await expect(mux.readUrl('http://foo/1')).rejects.toThrow(
|
||||
/^Reading from 'http:\/\/foo\/1' is not allowed. You may/,
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
|
||||
import { NotAllowedError } from '@backstage/errors';
|
||||
import { Logger } from 'winston';
|
||||
import {
|
||||
ReadTreeOptions,
|
||||
ReadTreeResponse,
|
||||
@@ -42,8 +41,6 @@ function notAllowedMessage(url: string) {
|
||||
export class UrlReaderPredicateMux implements UrlReader {
|
||||
private readonly readers: UrlReaderPredicateTuple[] = [];
|
||||
|
||||
constructor(private readonly logger: Logger) {}
|
||||
|
||||
register(tuple: UrlReaderPredicateTuple): void {
|
||||
this.readers.push(tuple);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export class UrlReaders {
|
||||
*/
|
||||
static create(options: UrlReadersOptions): UrlReader {
|
||||
const { logger, config, factories } = options;
|
||||
const mux = new UrlReaderPredicateMux(logger);
|
||||
const mux = new UrlReaderPredicateMux();
|
||||
const treeResponseFactory = DefaultReadTreeResponseFactory.create({
|
||||
config,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user