feat: add a waitBeforeRetry option to jest.retryTimes (#14737)#14738
feat: add a waitBeforeRetry option to jest.retryTimes (#14737)#14738SimenB merged 9 commits intojestjs:mainfrom
Conversation
✅ Deploy Preview for jestjs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
4db36ca to
f1464f0
Compare
3792d3d to
0f0f7e1
Compare
SimenB
left a comment
There was a problem hiding this comment.
thanks! in addition to my inline question, could you update the changelog?
| await dispatch({name: 'test_retry', test}); | ||
|
|
||
| if (waitBeforeRetry > 0) { | ||
| await new Promise(resolve => setTimeout(resolve, waitBeforeRetry)); |
There was a problem hiding this comment.
does this setTimeout work if fake timers are active? This code runs within the sandbox of user code, so we have to for instance make sure Date.now is the real one:
jest/scripts/babel-plugin-jest-native-globals.js
Lines 20 to 22 in 6ead171
There was a problem hiding this comment.
does using const {setTimeout} = globalThis; solve this?
b001602 to
3707c1a
Compare
|
Wait, CI seems unhappy |
119e6a5 to
d099675
Compare
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Fixes #14737 adding a new option
waitBeforeRetryto jest.retryTimesTest plan
The tests have been updated.