Use Lolex to implement Jest fake timers#7300
Closed
SimenB wants to merge 2 commits into
Closed
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.
|
SimenB
force-pushed
the
lolex-lite
branch
2 times, most recently
from
February 1, 2019 15:27
c3a887a to
c3fbec6
Compare
Member
Author
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.nowetc.).This is not meant to replace #5171.
Test plan
Tests tweaked