TechDocs: Update tests with mock url reader
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
import {
|
||||
createServiceBuilder,
|
||||
SingleHostDiscovery,
|
||||
UrlReader,
|
||||
} from '@backstage/backend-common';
|
||||
import { Server } from 'http';
|
||||
import { Logger } from 'winston';
|
||||
@@ -49,10 +50,18 @@ export async function startStandaloneServer(
|
||||
},
|
||||
});
|
||||
const discovery = SingleHostDiscovery.fromConfig(config);
|
||||
const mockUrlReader: jest.Mocked<UrlReader> = {
|
||||
read: jest.fn(),
|
||||
readTree: jest.fn(),
|
||||
};
|
||||
|
||||
logger.debug('Creating application...');
|
||||
const preparers = new Preparers();
|
||||
const directoryPreparer = new DirectoryPreparer(config, logger);
|
||||
const directoryPreparer = new DirectoryPreparer(
|
||||
config,
|
||||
logger,
|
||||
mockUrlReader,
|
||||
);
|
||||
preparers.register('dir', directoryPreparer);
|
||||
|
||||
const generators = new Generators();
|
||||
|
||||
Reference in New Issue
Block a user