diff --git a/packages/suite/jest.config.js b/packages/suite/jest.config.js index 2388098e122..2d360d08f0e 100644 --- a/packages/suite/jest.config.js +++ b/packages/suite/jest.config.js @@ -67,4 +67,9 @@ module.exports = { verbose: false, watchPlugins: ['jest-watch-typeahead/filename', 'jest-watch-typeahead/testname'], testEnvironment: 'jsdom', + fakeTimers: { + enableGlobally: false, + // https://jestjs.io/docs/28.x/upgrading-to-jest28#faketimers + legacyFakeTimers: true, + }, }; diff --git a/packages/suite/src/middlewares/wallet/__tests__/pollingMiddleware.test.ts b/packages/suite/src/middlewares/wallet/__tests__/pollingMiddleware.test.ts index 2840baa09d9..902d8777512 100644 --- a/packages/suite/src/middlewares/wallet/__tests__/pollingMiddleware.test.ts +++ b/packages/suite/src/middlewares/wallet/__tests__/pollingMiddleware.test.ts @@ -88,6 +88,11 @@ describe('pollingMiddleware', () => { jest.runOnlyPendingTimers(); expect(store.getActions()).toEqual([{ type: POLLING.REQUEST, key: 'fake' }]); + // todo: + // this assertion fails without + // legacyFakeTimers: true, + // (see jest.config.js) + // https://jestjs.io/docs/28.x/upgrading-to-jest28#faketimers expect(setTimeout).toHaveBeenCalledTimes(1); });