diff --git a/src/account.test.ts b/src/account.test.ts index 1b4b2c1..e1d835e 100644 --- a/src/account.test.ts +++ b/src/account.test.ts @@ -8,6 +8,11 @@ import { AWSConfig } from './config'; import { mockClient } from 'aws-sdk-client-mock'; import AWSMock from 'aws-sdk-mock'; +jest.mock('./logger', () => ({ + ...jest.requireActual('./logger'), + showSpinner: jest.fn(), +})); + describe('getAccountAlias', () => { const organizationsMock = mockClient(OrganizationsClient); diff --git a/src/cost.test.ts b/src/cost.test.ts index dc6f24f..d1262c1 100644 --- a/src/cost.test.ts +++ b/src/cost.test.ts @@ -11,6 +11,11 @@ const costDataLength = 65; const fixedToday = '2024-05-11'; // cost of 'this month' will be sum of 10 days from May 1 to May 10 ('today' is omitted because its cost is incomplete) const fixedFirstDay = dayjs(fixedToday).subtract(costDataLength, 'day'); +jest.mock('./logger', () => ({ + ...jest.requireActual('./logger'), + showSpinner: jest.fn(), +})); + describe('Cost Functions', () => { beforeAll(() => { AWSMock.setSDKInstance(AWS); diff --git a/src/printers/slack.test.ts b/src/printers/slack.test.ts index 2ad7878..6ae52c8 100644 --- a/src/printers/slack.test.ts +++ b/src/printers/slack.test.ts @@ -17,6 +17,11 @@ const awsConfig: AWSConfig = { region: 'us-east-1', }; +jest.mock('../logger', () => ({ + ...jest.requireActual('../logger'), + showSpinner: jest.fn(), +})); + const mockedCostByService = generateMockedCostByService( fixedToday, costDataLength,