Merge branch 'winh-jest-time' into 'master'
Mock and wait for timers in Jest Closes #56056 See merge request gitlab-org/gitlab-ce!26433
This commit is contained in:
commit
5765c5989a
2 changed files with 6 additions and 0 deletions
|
@ -36,4 +36,5 @@ module.exports = {
|
|||
'^.+\\.vue$': 'vue-jest',
|
||||
},
|
||||
transformIgnorePatterns: ['node_modules/(?!(@gitlab/ui)/)'],
|
||||
timers: 'fake',
|
||||
};
|
||||
|
|
|
@ -3,6 +3,11 @@ import Translate from '~/vue_shared/translate';
|
|||
import axios from '~/lib/utils/axios_utils';
|
||||
import { initializeTestTimeout } from './helpers/timeout';
|
||||
|
||||
// wait for pending setTimeout()s
|
||||
afterEach(() => {
|
||||
jest.runAllTimers();
|
||||
});
|
||||
|
||||
initializeTestTimeout(300);
|
||||
|
||||
// fail tests for unmocked requests
|
||||
|
|
Loading…
Reference in a new issue