-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
feat(fake-timers)!: allow jest.useFakeTimers()
and projectConfig.fakeTimers
to take an options bag
#12572
Conversation
@mrazauskas i had a doubt if you can explain and this is out of this pr, how is the deploy netlify preview configured in the codebase , anyone |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good!
@SimenB What if migration guide would be added? See last commit. This is just a draft, to illustrate the idea. Could be moved to separate PR and polished there. |
Yeah, we can do an upgrade guide, I like it! I reverted that commit for now to land this, but a generic "how to upgrade to v28" sounds like a good idea to me! 👍 loooooooots of breaking changes |
jest.useFakeTimers()
and projectConfig.fakeTimers
to take an options bagjest.useFakeTimers()
and projectConfig.fakeTimers
to take an options bag
This is amazing work @mrazauskas, thank you so much! |
Great! I will open a PR with How to Upgrade Guide. |
Thank you for doing this @mrazauskas ! I've been following #11661 closely, and I'm very happy to see it resolved finally! |
@SimenB For some reason few recent updates of documentation are not yet included on Jest website. It either fails to rebuild or there are cache problems on my side. Can I ask to take a quick look? (; |
Hmm, something is wrong with the deployment: https://app.netlify.com/sites/jestjs/deploys/624d79914cda8b0008589faa |
@mrazauskas fixed now 🙂 Thanks for noticing! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Resolves #8257 (allows
jest.useFakeTimers({timerLimit: 10});
)Resolves #10602 (allows
jest.useFakeTimers({advanceTimers: 30, now: new Date('2015-09-25')});
)Resolves #12055 (allows workaround
jest.useFakeTimers({doNotFake: ['performance']});
)Closes #11661
Closes #12362
Closes #12452
Summary
As it is mentioned in the linked issues, it would be very useful to allow
jest.useFakeTimers()
andprojectConfig.fakeTimers
to take an options object, which would configure underling@sinonjs/fake-timers
. E.g.loopLimit
,shouldAdvanceTime
,toFake
and all other options.ToDo
Test plan
Current and new unit, e2e and type tests should pass.