Skip to content

fix(deps): update fake-timers to 15.3.2. support toNotFake - #10043

Merged
sheremet-va merged 8 commits into
vitest-dev:mainfrom
BPScott:faketimers
May 18, 2026
Merged

sheremet-va merged 8 commits into
vitest-dev:mainfrom
BPScott:faketimers

Conversation

@BPScott

@BPScott BPScott commented Apr 2, 2026 •

Copy link
Copy Markdown
Contributor

Description

Updating fake-timers to v15.3.2

This version adds bundled types, a fix to properly restore cancelIdleCallback when uninstalling fake timers, and a toNotFake API to complement toFake

  • Use bundled types instead of @types/sinonjs__fake-timers
  • Document passing toNotFake into vi.useFakeTimers()

AI disclaimer: This code was AI generated with Copilot using the Sonnet model. I babysat it heavily and iterated to make sure it matches existing patterns and produced as minimal a change as possible.

Question for reviewers

At the moment, toNotFake will require the user to add nextTick to ensure that nextTick is not mocked, otherwise we'll often throw an error. Should that be added by default?

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify

netlify Bot commented Apr 2, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5e07568
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6a0aec85d314900008e8b0ec
😎 Deploy Preview https://deploy-preview-10043--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sheremet-va sheremet-va added this to the 5.0.0 milestone Apr 7, 2026
@sheremet-va sheremet-va added the p2-nice-to-have Not breaking anything but nice to have (priority) label Apr 9, 2026
@sheremet-va

Copy link
Copy Markdown
Member

There is a merge conflict. Could you resolve it, please?

@BPScott
BPScott force-pushed the faketimers branch 2 times, most recently from 23782c9 to 28ff20b Compare April 28, 2026 23:05
@BPScott

BPScott commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

@sheremet-va I have rebased atop latest main

@BPScott
BPScott force-pushed the faketimers branch 2 times, most recently from 21bbd23 to 156f173 Compare April 29, 2026 06:14
@BPScott BPScott changed the title fix: Update fake-timers to 15.3.0 fix: Update fake-timers to 15.3.2 Apr 29, 2026
Comment thread docs/config/faketimers.md Resolved
BPScott added 2 commits May 16, 2026 13:43
This version adds bundled types, and a `toNotFake` API to complement
`toFake`

- Use bundled types instead of @types/sinonjs__fake-timers
- Allow passing toNotFake into `vi.useFakeTimers()`
@BPScott

BPScott commented May 16, 2026

Copy link
Copy Markdown
Contributor Author

@sheremet-va I've rebased atop latest main, and CI is all green. Ready for your re-review.

@hi-ogawa

Copy link
Copy Markdown
Collaborator

Fake timer now released 15.4.0 https://github.com/sinonjs/fake-timers/blob/main/CHANGELOG.md#1540--2026-05-05
Not necessary in this PR but would be nice to include that for Vitest 5 for temporal support

@hi-ogawa hi-ogawa self-assigned this May 18, 2026
@hi-ogawa hi-ogawa changed the title fix: Update fake-timers to 15.3.2 fix(deps): update fake-timers to 15.3.2. support toNotFake May 18, 2026

@hi-ogawa hi-ogawa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks for the PR. I've pushed some tweaks. I think we can bump 15.4.0 separately as a follow up as it involves some temporal related update (at least docs probably)

@sheremet-va
sheremet-va merged commit bbf2f0d into vitest-dev:main May 18, 2026
17 checks passed
@BPScott

BPScott commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the tweaks and merge @hi-ogawa.

@github-actions github-actions Bot locked and limited conversation to collaborators Aug 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

p2-nice-to-have Not breaking anything but nice to have (priority)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants