gitlab-org--gitlab-foss/spec/frontend/test_setup.js

17 lines
530 B
JavaScript
Raw Normal View History

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