Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jest.useFakeTimers no longer works #13

Closed
lbargery opened this issue Jan 28, 2024 · 2 comments
Closed

jest.useFakeTimers no longer works #13

lbargery opened this issue Jan 28, 2024 · 2 comments

Comments

@lbargery
Copy link

Hi,

I just discovered this (very helpful!) package after stumbling across the jest issue here jestjs/jest#2549

My issue was that in a test I was getting different behaviour from a mongoose library that use instanceof Function. However, when installing your package I've found that jest.useFakeTimers no longer works. Is that expected? If so, is there any way around this? Would value some advice on how best to mock time now!

Thanks

@kayahr
Copy link
Owner

kayahr commented Jan 28, 2024

Never used Jest's fake timers but I think/hope I managed to implement them. I tried some examples from the Jest documentation and they seem to work now.

Please try the new version 29.3.0 and let me know if fake timers work now as expected.

@lbargery
Copy link
Author

Seems to work! Thanks so much for the ultra quick fix!! :)

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

No branches or pull requests

2 participants