diff --git a/tests/handlers/createTransactions.test.ts b/tests/handlers/createTransactions.test.ts index 1825308..a25b71a 100644 --- a/tests/handlers/createTransactions.test.ts +++ b/tests/handlers/createTransactions.test.ts @@ -5,6 +5,13 @@ import { connectToDatabase } from '../../src/utils/connectToDB' import { handler as createTransactionHandler } from '../../src/handlers/createTransaction' jest.mock('../../src/utils/connectToDB') +jest.mock('aws-sdk', () => { + const EventBridge = { + putEvents: jest.fn().mockReturnThis(), + promise: jest.fn().mockResolvedValue({}), + }; + return { EventBridge: jest.fn(() => EventBridge) }; +}); describe('createTransactionHandler', () => { beforeAll(async () => { diff --git a/tests/services/transactionsService.test.ts b/tests/services/transactionsService.test.ts index db601ce..940ca76 100644 --- a/tests/services/transactionsService.test.ts +++ b/tests/services/transactionsService.test.ts @@ -11,6 +11,13 @@ import { } from '../../src/dto/transaction' jest.mock('../../src/services/accountsService') +jest.mock('aws-sdk', () => { + const EventBridge = { + putEvents: jest.fn().mockReturnThis(), + promise: jest.fn().mockResolvedValue({}), + }; + return { EventBridge: jest.fn(() => EventBridge) }; +}); describe('TransactionsService', () => { let transactionsService: TransactionsService