summaryrefslogtreecommitdiff
path: root/spec/frontend/test_setup.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/test_setup.js')
-rw-r--r--spec/frontend/test_setup.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/frontend/test_setup.js b/spec/frontend/test_setup.js
index 00d7873ab2b..d13e8a1908c 100644
--- a/spec/frontend/test_setup.js
+++ b/spec/frontend/test_setup.js
@@ -5,10 +5,13 @@ import { initializeTestTimeout } from './helpers/timeout';
process.on('unhandledRejection', global.promiseRejectionHandler);
-// wait for pending setTimeout()s
-afterEach(() => {
- jest.runAllTimers();
-});
+afterEach(() =>
+ // give Promises a bit more time so they fail the right test
+ new Promise(setImmediate).then(() => {
+ // wait for pending setTimeout()s
+ jest.runAllTimers();
+ }),
+);
initializeTestTimeout(300);