-
Notifications
You must be signed in to change notification settings - Fork 469
fix: runWithRealTimers to be compatible with new version of jest #649
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: runWithRealTimers to be compatible with new version of jest #649
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 092a72f:
|
Codecov Report
@@ Coverage Diff @@
## master #649 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 574 574
Branches 145 145
=========================================
Hits 574 574
Continue to review full report at Codecov.
|
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.
Thanks!
globalObj.setTimeout && | ||
globalObj.setTimeout._isMockFunction && | ||
(globalObj.setTimeout._isMockFunction || | ||
typeof globalObj.setTimeout.clock !== 'undefined') && |
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.
Sensible 👍
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.
I have tried to find a different way but I didn't find
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.
Super 👏
🎉 This PR is included in version 7.15.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
What:
This change will fix issue #612.
Why:
With the version 26.0.0 of jest the
jest.useFakeTimers
function uses@sinonjs/fake-timers
.With this new package the property
_isMockFunction
is no more available.How:
To fix the issue I have added a new check to
clock
property.@testing-library/dom
is now compatible with both version ofuseFakeTimers
, the legacy and the modern one.Checklist:
docs site