Skip to content

Commit

Permalink
fix: unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
NithinKuruba committed Feb 4, 2025
1 parent 2e523a6 commit 50a4bee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lambda/__tests__/20.bcsc.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ jest.mock('@lambda-app/bcsc/client', () => {
};
});

jest.mock('@lambda-app/queries/request', () => {
const original = jest.requireActual('@lambda-app/queries/request');
return {
...original,
getIntegrationById: jest.fn(() => Promise.resolve({ lastChanges: [] })),
};
});

const OLD_ENV = process.env;
beforeEach(() => {
jest.resetModules();
Expand Down
2 changes: 1 addition & 1 deletion lambda/app/src/controllers/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ export const createBCSCIntegration = async (env: string, integration: Integratio
bcscClient.clientName = bcscClientName;
bcscClient.save();

const integrationLastChanges = await getIntegrationById(integration.id).then((data) => data.lastChanges);
const integrationLastChanges = await getIntegrationById(integration.id).then((data) => data?.lastChanges);

if (
integrationLastChanges !== null &&
Expand Down

0 comments on commit 50a4bee

Please sign in to comment.