Skip to content
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

Closed
wants to merge 3 commits into from
Closed

docs: Clarify timer-mocks page #11324

wants to merge 3 commits into from

Conversation

ErfanMirzapour
Copy link

@ErfanMirzapour ErfanMirzapour commented Apr 21, 2021

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!

@facebook-github-bot
Copy link
Contributor

Hi @ErfanMirzapour!

Thank you for your pull request and welcome to our community.

Action Required

In 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.

Process

In 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 CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the added stuff looks good 👍 Should just avoid the extra diffs.

Also, please update all the versions of this doc:
image

'use strict';

jest.useFakeTimers();
// timerGame.test.js
Copy link
Member

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';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep this

@ErfanMirzapour
Copy link
Author

the added stuff looks good 👍 Should just avoid the extra diffs.

Also, please update all the versions of this doc:
image

Done!

@codecov-commenter
Copy link

Codecov Report

Merging #11324 (fb42700) into master (6fcdb1e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fcdb1e...fb42700. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Sep 8, 2022

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.

@github-actions github-actions bot added the Stale label Sep 8, 2022
@github-actions
Copy link

github-actions bot commented Oct 8, 2022

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.

@github-actions github-actions bot closed this Oct 8, 2022
@github-actions
Copy link

github-actions bot commented Nov 8, 2022

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants