-
-
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
chore: remove long-deprecated timer globals #7285
Conversation
if (envGlobal.mockClearTimers) { | ||
envGlobal.mockClearTimers(); | ||
if (this._environment.fakeTimers) { | ||
this._environment.fakeTimers.clearAllTimers(); |
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.
I'll copy my comment over, but does it make sense to do this? Would one expect resetModules
to remove scheduled fake timers?
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.
Maybe if you consider fake timers and mocks to be in the same "group". In your other PR might make less sense as you're making that distinction clearer.
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.
I'd expect people to call jest.clearAllTimers
themselves if needed, tbh. Not sure how breaking that is, though
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.
I can tell you that pretty easily, haha
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.
LGTM, I'm also curious about https://github.com/facebook/jest/pull/7285/files?w=1#r228547157
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.
Looks good!
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. |
Summary
Part of #5171, but as it's pretty breaking on its own, it'd be great to land separately
Test plan
Green CI