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

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 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
}),
);