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.

14 lines
414 B
JavaScript
Raw Normal View History

/* Setup for unit test environment */
// eslint-disable-next-line no-restricted-syntax
import { setImmediate } from 'timers';
import 'helpers/shared_test_setup';
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
}),
);