-
由 Mark Florian 创作于
This does not replace some instances of `setImmediate` in helpers and test environment configuration files, as these are well-contained, and can be rewritten later, if need be. The addition of the lint rule should prevent more usages of `setImmediate` appearing. This is the final part of https://gitlab.com/gitlab-org/gitlab/-/issues/344247.
由 Mark Florian 创作于This does not replace some instances of `setImmediate` in helpers and test environment configuration files, as these are well-contained, and can be rewritten later, if need be. The addition of the lint rule should prevent more usages of `setImmediate` appearing. This is the final part of https://gitlab.com/gitlab-org/gitlab/-/issues/344247.
代码所有者
将用户和群组指定为特定文件更改的核准人。 了解更多。
test_setup.js 530 B
/* Setup for unit test environment */
import 'helpers/shared_test_setup';
import { initializeTestTimeout } from 'helpers/timeout';
jest.mock('~/lib/utils/axios_utils', () => jest.requireActual('helpers/mocks/axios_utils'));
initializeTestTimeout(process.env.CI ? 6000 : 500);
afterEach(() =>
// give Promises a bit more time so they fail the right test
// eslint-disable-next-line no-restricted-syntax
new Promise(setImmediate).then(() => {
// wait for pending setTimeout()s
jest.runOnlyPendingTimers();
}),
);