Skip to content

fix: override fake timers when useFakeTimers is called multiple times#8504

Merged
sheremet-va merged 2 commits into
vitest-dev:mainfrom
sheremet-va:fix/timers-override-calls
Aug 29, 2025
Merged

fix: override fake timers when useFakeTimers is called multiple times#8504
sheremet-va merged 2 commits into
vitest-dev:mainfrom
sheremet-va:fix/timers-override-calls

Conversation

@sheremet-va

@sheremet-va sheremet-va commented Aug 29, 2025

Copy link
Copy Markdown
Member

Fixes #8464

This PR

  • overrides fake timers when useFakeTimers is called multiple times (previously only the first call would be respected)
  • improves the error message when fake timer methods were called without useFakeTimers

@netlify

netlify Bot commented Aug 29, 2025

Copy link
Copy Markdown

Deploy Preview for vitest-dev ready!

Name Link
🔨 Latest commit 3fe54df
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/68b16e4385e0e30008cd933a
😎 Deploy Preview https://deploy-preview-8504--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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

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.

useFakeTimers({now: ...}) leaks between tests

1 participant