Repository navigation
Vitest fake timers don't affect storage simulators #16893
workers-devprod
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Moved from #5394. Originally opened by mrbbot on 2024-03-26.
Vitest's fake timers do not apply to KV, R2 and cache simulators. They also don't apply to Durable Object alarms. For example, you cannot expire a KV key by advancing fake time. Ideally, this would work.
Miniflare has an existing fake timer system for its own tests: https://github.com/cloudflare/workers-sdk/blob/426906a96b378823295067fc9ca8a495712ae94e/packages/miniflare/src/workers/shared/timers.worker.ts It should be possible to hook Vitest's fake timers system into this, though it might be tricky to do this synchronously across a service boundary... 🤔
rxliuli commented on 2025-02-23:
The same question, how are you solving it now?
All reactions