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

Fail when a timer is not available in the context #491

Merged
merged 2 commits into from Feb 12, 2024

Conversation

fatso83
Copy link
Contributor

@fatso83 fatso83 commented Feb 10, 2024

Purpose (TL;DR) - mandatory

fix #490

This makes FakeTimers stricter by failing when trying to fake
a timer or object that is not present on the (chosen) global object.

To make transitioning easier, we provide a flag to revert to the
behavior where missing timers were (mostly) ignored.

Background (Problem in detail) - optional

See #490

This makes FakeTimers stricter by failing when trying to fake
a timer or object that is not present on the (chosen) global object.

To make transitioning easier, we provide a flag to revert to the
behavior where missing timers were (mostly) ignored.
Copy link

codecov bot commented Feb 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (cc58937) 97.50% compared to head (4667c29) 97.50%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #491   +/-   ##
=======================================
  Coverage   97.50%   97.50%           
=======================================
  Files          16       16           
  Lines        3960     3968    +8     
=======================================
+ Hits         3861     3869    +8     
  Misses         99       99           
Flag Coverage Δ
unit 97.50% <100.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fatso83 fatso83 merged commit 3412033 into sinonjs:main Feb 12, 2024
11 checks passed
@fatso83 fatso83 deleted the fix-490-always-throw-on-missing-timers branch February 12, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant