debian-mirror-gitlab/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

2022-01-26 12:08:38 +05:30
/* Setup for unit test environment */
2022-08-27 11:52:29 +05:30
// eslint-disable-next-line no-restricted-syntax
import { setImmediate } from 'timers';
2022-01-26 12:08:38 +05:30
import 'helpers/shared_test_setup';
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
}),
);