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

Add clock.jump method #465

Merged
merged 2 commits into from May 13, 2023
Merged

Add clock.jump method #465

merged 2 commits into from May 13, 2023

Conversation

CreativeTechGuy
Copy link
Contributor

Purpose (TL;DR)

Closes #452 by creating the clock.jump(time) method enabling skipping forward in time and running any timers at most once.

@codecov
Copy link

codecov bot commented Apr 28, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.04 🎉

Comparison is base (947a7e7) 95.53% compared to head (9d4689e) 95.57%.

❗ Current head 9d4689e differs from pull request most recent head 2a99c0c. Consider uploading reports for the commit 2a99c0c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #465      +/-   ##
==========================================
+ Coverage   95.53%   95.57%   +0.04%     
==========================================
  Files           2        2              
  Lines         649      656       +7     
==========================================
+ Hits          620      627       +7     
  Misses         29       29              
Flag Coverage Δ
unit 95.57% <100.00%> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/fake-timers-src.js 95.56% <100.00%> (+0.04%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@fatso83
Copy link
Contributor

fatso83 commented May 13, 2023

I think this looks good. Cannot see any reason not to merge?

@fatso83 fatso83 merged commit 556f689 into sinonjs:main May 13, 2023
9 checks passed
@fatso83
Copy link
Contributor

fatso83 commented May 13, 2023

Any chance of adding this to the Sinon docs on fake timers? https://github.com/sinonjs/sinon/blob/main/docs/release-source/release/fake-timers.md

@fatso83
Copy link
Contributor

fatso83 commented May 13, 2023

This is part of @sinonjs/fake-timers@10.1.0

@CreativeTechGuy
Copy link
Contributor Author

Any chance of adding this to the Sinon docs on fake timers? https://github.com/sinonjs/sinon/blob/main/docs/release-source/release/fake-timers.md

Yeah. Those docs look far more out of sync than just this, but I can add this new method if you'd like!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Jump forward in time to simulate throttled timers
3 participants