sinonjs / fake-timers

Fake setTimeout and friends (collectively known as "timers"). Useful in your JavaScript tests. Extracted from Sinon.JS
BSD 3-Clause "New" or "Revised" License
793 stars 103 forks source link

Fix for #483 and jestjs/jest#14549 #485

Closed fatso83 closed 8 months ago

fatso83 commented 8 months ago

Purpose (TL;DR) - mandatory

Fix the async time forwarders that seemed to not run enqueued micro-tasks.

Background (Problem in detail) - optional

See #483 for details

I will move the tests around, as they were used to just verify the original issue. Posting the draft here.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (f6ef392) 96.48% compared to head (25dc957) 96.49%.

:exclamation: Current head 25dc957 differs from pull request most recent head 8b16f52. Consider uploading reports for the commit 8b16f52 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #485 +/- ## ========================================== + Coverage 96.48% 96.49% +0.01% ========================================== Files 2 2 Lines 682 684 +2 ========================================== + Hits 658 660 +2 Misses 24 24 ``` | [Flag](https://app.codecov.io/gh/sinonjs/fake-timers/pull/485/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/sinonjs/fake-timers/pull/485/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | `96.49% <100.00%> (+0.01%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/sinonjs/fake-timers/pull/485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs) | Coverage Δ | | |---|---|---| | [src/fake-timers-src.js](https://app.codecov.io/gh/sinonjs/fake-timers/pull/485?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sinonjs#diff-c3JjL2Zha2UtdGltZXJzLXNyYy5qcw==) | `96.51% <100.00%> (+0.01%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.