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

[WIP] Update documentation for Timer Mocks #11731

Closed
wants to merge 5 commits into from

Conversation

sigveio
Copy link
Contributor

@sigveio sigveio commented Aug 4, 2021

Summary

The Timer Mocks guide in the documentation is currently out of date with examples based on the old legacy timers. Very few of the examples work anymore, and this seems to generate quite a few bug reports and support requests in the issue tracker and across various other channels.

My goal with this PR is to bring it up to date, and also change the structure slightly to drive home some of the more important points early on.

The PR contains some minor tweaks to the website to accommodate this:

Preview

A preview is available here. Feedback is welcome :-)

Todo

Please note that this is a "work in progress"

  • Basic structure
  • Code example for enabling fake timers
  • Code example for recursive timers
  • Code example for advancing by time
  • Code example for stepping through timers
  • Move examples/timer -> examples/timer/legacy
  • Add new code examples under examples/timer/modern
  • Add F.A.Q.s -- Suggestions, anyone?
  • Consider tweaking colors of highlighting and 'Note' admonition
  • Fine tune the language

Test plan

n/a

Supersedes #11324, #10964, #10022
Closes #11713

docs/TimerMocks.md Outdated Show resolved Hide resolved
@sigveio sigveio force-pushed the update-timer-docs branch 2 times, most recently from d09aff6 to f25caff Compare August 4, 2021 18:13
@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2021

Codecov Report

Merging #11731 (cbe8143) into master (98f10e6) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #11731   +/-   ##
=======================================
  Coverage   69.04%   69.04%           
=======================================
  Files         312      312           
  Lines       16366    16366           
  Branches     4746     4746           
=======================================
  Hits        11300    11300           
  Misses       5039     5039           
  Partials       27       27           

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 98f10e6...cbe8143. Read the comment docs.

@SimenB SimenB marked this pull request as ready for review August 16, 2021 13:04
@SimenB SimenB marked this pull request as draft August 16, 2021 13:04
@SimenB
Copy link
Member

SimenB commented Aug 16, 2021

(sorry, misclicked)

The PR contains some minor tweaks to the website to accommodate this:

Could you separate those out into another PR so this one can be just the changed text?

@sigveio
Copy link
Contributor Author

sigveio commented Aug 16, 2021

Could you separate those out into another PR so this one can be just the changed text?

Yep, can do; I just thought it would make sense to keep them here while it's a draft so that it can be previewed together. Since afaik line highlighting or the admonition in question aren't used elsewhere so far. I would suggest that I cherry pick these out when the PR is all tied up and ready.

I also noticed today that my F.A.Q. answer is inaccurate; since it's still possible to spy on the global yourself. So I will adjust that and try to think of another way to encourage the point I was trying to make re: decoupling from implementation details

@SimenB
Copy link
Member

SimenB commented Feb 23, 2022

Lost track of this, sorry @sigveio! I really like these changes, would you be interested in reviving this PR?

@sigveio
Copy link
Contributor Author

sigveio commented May 8, 2022

No worries, @SimenB - and sorry for not following up myself lately. If this is still needed I can try and pick the ball back up. :-) Very happy to see that you also continued work on #11778 while I was AWOL. Thanks! ❤️

@github-actions
Copy link

github-actions bot commented May 8, 2023

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 May 8, 2023
@github-actions
Copy link

github-actions bot commented Jun 7, 2023

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 Jun 7, 2023
@github-actions
Copy link

github-actions bot commented Jul 8, 2023

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 Jul 8, 2023
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.

doc : jest fake timers : expect on setTimeout not working
5 participants