@@ -27,9 +27,11 @@ import { Knex } from 'knex';
|
||||
|
||||
jest.mock('./fact/FactRetrieverRegistry');
|
||||
jest.mock('./fact/FactRetrieverEngine', () => ({
|
||||
create: jest.fn().mockResolvedValue({
|
||||
schedule: jest.fn(),
|
||||
}),
|
||||
FactRetrieverEngine: {
|
||||
create: jest.fn().mockResolvedValue({
|
||||
schedule: jest.fn(),
|
||||
}),
|
||||
},
|
||||
}));
|
||||
|
||||
describe('buildTechInsightsContext', () => {
|
||||
@@ -68,7 +70,6 @@ describe('buildTechInsightsContext', () => {
|
||||
discovery: discoveryMock,
|
||||
tokenManager: ServerTokenManager.noop(),
|
||||
});
|
||||
|
||||
expect(DefaultFactRetrieverRegistry).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
@@ -85,7 +86,6 @@ describe('buildTechInsightsContext', () => {
|
||||
discovery: discoveryMock,
|
||||
tokenManager: ServerTokenManager.noop(),
|
||||
});
|
||||
|
||||
expect(DefaultFactRetrieverRegistry).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -120,6 +120,7 @@ export const buildTechInsightsContext = async <
|
||||
scheduler,
|
||||
tokenManager,
|
||||
} = options;
|
||||
logger.info('HERE1');
|
||||
|
||||
const buildFactRetrieverRegistry = (): FactRetrieverRegistry => {
|
||||
if (!options.factRetrieverRegistry) {
|
||||
@@ -139,6 +140,7 @@ export const buildTechInsightsContext = async <
|
||||
await database.getClient(),
|
||||
{ logger },
|
||||
);
|
||||
logger.info('HERE2');
|
||||
|
||||
const factRetrieverEngine = await FactRetrieverEngine.create({
|
||||
scheduler,
|
||||
|
||||
Reference in New Issue
Block a user