Wait for pending timers in Jest

This commit is contained in:
Winnie Hellmann 2019-03-21 18:05:21 +01:00
parent 939140c33e
commit d1251b42a0

View file

@ -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