2021-11-23 12:14:32 +00:00
|
|
|
/* Setup for unit test environment */
|
|
|
|
import 'helpers/shared_test_setup';
|
|
|
|
import { initializeTestTimeout } from 'helpers/timeout';
|
2019-02-20 19:59:44 +00:00
|
|
|
|
2021-11-23 12:14:32 +00:00
|
|
|
jest.mock('~/lib/utils/axios_utils', () => jest.requireActual('helpers/mocks/axios_utils'));
|
2019-06-22 03:35:51 +00:00
|
|
|
|
2021-11-23 12:14:32 +00:00
|
|
|
initializeTestTimeout(process.env.CI ? 6000 : 500);
|
2021-02-10 15:11:19 +00:00
|
|
|
|
2019-03-25 20:32:48 +00:00
|
|
|
afterEach(() =>
|
|
|
|
// give Promises a bit more time so they fail the right test
|
2022-02-22 15:18:06 +00:00
|
|
|
// eslint-disable-next-line no-restricted-syntax
|
2019-03-25 20:32:48 +00:00
|
|
|
new Promise(setImmediate).then(() => {
|
|
|
|
// wait for pending setTimeout()s
|
2020-04-04 00:09:37 +00:00
|
|
|
jest.runOnlyPendingTimers();
|
2019-03-25 20:32:48 +00:00
|
|
|
}),
|
|
|
|
);
|