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