Wait for pending timers in Jest
This commit is contained in:
parent
939140c33e
commit
d1251b42a0
1 changed files with 5 additions and 0 deletions
|
@ -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