-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Use Lolex to implement Jest fake timers #7300
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7300 +/- ##
==========================================
+ Coverage 62.19% 67.98% +5.78%
==========================================
Files 266 253 -13
Lines 10701 9549 -1152
Branches 2603 6 -2597
==========================================
- Hits 6656 6492 -164
+ Misses 3459 3055 -404
+ Partials 586 2 -584
Continue to review full report at Codecov.
|
c3a887a
to
c3fbec6
Compare
This still broke FB horribly |
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
This is an alternative to #5171, that's the exact same except for the last commit, which makes sure to just mock the APIs that Jest is currently mocking, which are these: https://github.com/facebook/jest/blob/fb61bfffb803bad0c2ff9ab1798a6c4c31cb14fa/packages/jest-util/src/FakeTimers.js#L104-L113.
Hopefully, this can be merged and applied at FB, and then we can merge #5171 which will mock the rest of the timers (
Date
,requestAnimationFrame
,performance.now
etc.).This is not meant to replace #5171.
Test plan
Tests tweaked