vitest/web-worker and using fake timers #6473
Unanswered
danwoods89
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there, I have a web worker which uses setTimeout inside. In my unit tests for it, vi.useFakeTimers and vi.advanceTimersByTime does not impact the setTimeout within the web worker. It never hits setTimeout's callback. If I use vi.getTimerCount it shows as 0.
Are fake timers supposed to work with web workers and I am simply doing something wrong? Many thanks.
Beta Was this translation helpful? Give feedback.
All reactions