-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove side-effect from runWithRealTimers #887
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit f6a6eda:
|
Codecov Report
@@ Coverage Diff @@
## master #887 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 26 26
Lines 951 941 -10
Branches 288 283 -5
=========================================
- Hits 951 941 -10
Continue to review full report at Codecov.
|
Going to test this build on Material-UI first so that we have a integration test with non-jest setups. PR: mui/material-ui#25008 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM: #887 (comment)
@all-contributors add @ph-fritsche for code @ph-fritsche Thanks! |
I've put up a pull request to add @ph-fritsche! 🎉 |
🎉 This PR is included in version 7.29.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What:
Rewritten
runWithRealTimers
and the related tests.Why:
runWithRealTimers
activated fake timers when ajest.useFakeTimers('modern')
has been used in any test before.The tests leaked
setTimeout
.See #884 and #886
How:
Call
jest.useRealTimers
and check if any timer functions changed to determine if fake timers have been active.Checklist:
docs site