-
-
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
docs: Clarify timer-mocks page #11324
Conversation
Hi @ErfanMirzapour! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks! |
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.
'use strict'; | ||
|
||
jest.useFakeTimers(); | ||
// timerGame.test.js |
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.
don't change the name of the file (not that it really matters, but it's extra noise in the diff)
@@ -7,8 +7,6 @@ The native timer functions (i.e., `setTimeout`, `setInterval`, `clearTimeout`, ` | |||
|
|||
```javascript | |||
// timerGame.js | |||
'use strict'; |
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.
keep this
Codecov Report
@@ Coverage Diff @@
## master #11324 +/- ##
=======================================
Coverage 64.17% 64.17%
=======================================
Files 308 308
Lines 13528 13528
Branches 3297 3297
=======================================
Hits 8682 8682
Misses 4132 4132
Partials 714 714 Continue to review full report at Codecov.
|
This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days. |
This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one. |
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. |
Documentation page:
https://jestjs.io/docs/timer-mocks
Summary
I think this page currently is confusing for readers.
Half of the tests on the page will fail after run!
All sections need fake-timers to be set and this hasn't been mentioned anywhere in the documentation!
+Some clean-up!