debian-mirror-gitlab/spec/frontend/test_setup.js

17 lines
530 B
JavaScript
Raw Normal View History

2022-01-26 12:08:38 +05:30
/* Setup for unit test environment */
import 'helpers/shared_test_setup';
import { initializeTestTimeout } from 'helpers/timeout';
2019-09-30 21:07:59 +05:30
2022-01-26 12:08:38 +05:30
jest.mock('~/lib/utils/axios_utils', () => jest.requireActual('helpers/mocks/axios_utils'));
2019-02-15 15:39:39 +05:30
2022-01-26 12:08:38 +05:30
initializeTestTimeout(process.env.CI ? 6000 : 500);
2021-03-11 19:13:27 +05:30
2019-07-07 11:18:12 +05:30
afterEach(() =>
// give Promises a bit more time so they fail the right test
2022-05-07 20:08:51 +05:30
// eslint-disable-next-line no-restricted-syntax
2019-07-07 11:18:12 +05:30
new Promise(setImmediate).then(() => {
// wait for pending setTimeout()s
2020-04-22 19:07:51 +05:30
jest.runOnlyPendingTimers();
2019-07-07 11:18:12 +05:30
}),
);