Jest test setup #273
-
Hello everyone, I'm quite new to testing with jest. I'm having trouble with creating a simple test for the idle timer. The problem happens when I add Best, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Hey @AndrianStoikov, Have you checked out https://idletimer.dev/docs/getting-started/testing? Basically you just need to call |
Beta Was this translation helpful? Give feedback.
Hey @AndrianStoikov,
Have you checked out https://idletimer.dev/docs/getting-started/testing?
Basically you just need to call
createMocks()
in your test setup. That's going to essentially override the web worker timers with native timers for your tests.