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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
436 B
JavaScript
Raw Normal View History

/* Setup for unit test environment */
import 'helpers/shared_test_setup';
import { initializeTestTimeout } from 'helpers/timeout';
2019-02-20 19:59:44 +00:00
initializeTestTimeout(process.env.CI ? 6000 : 500);
2019-03-25 20:32:48 +00:00
afterEach(() =>
// give Promises a bit more time so they fail the right test
// eslint-disable-next-line no-restricted-syntax
2019-03-25 20:32:48 +00:00
new Promise(setImmediate).then(() => {
// wait for pending setTimeout()s
jest.runOnlyPendingTimers();
2019-03-25 20:32:48 +00:00
}),
);