Skip to content

chore: remove long-deprecated timer globals#7285

Merged
SimenB merged 6 commits into
jestjs:masterfrom
SimenB:remove-timer-globals
Oct 26, 2018
Merged

chore: remove long-deprecated timer globals#7285
SimenB merged 6 commits into
jestjs:masterfrom
SimenB:remove-timer-globals

Conversation

@SimenB

@SimenB SimenB commented Oct 26, 2018

Copy link
Copy Markdown
Member

Summary

Part of #5171, but as it's pretty breaking on its own, it'd be great to land separately

Test plan

Green CI

Comment thread CHANGELOG.md
if (envGlobal.mockClearTimers) {
envGlobal.mockClearTimers();
if (this._environment.fakeTimers) {
this._environment.fakeTimers.clearAllTimers();

Copy link
Copy Markdown
Member Author

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?

@rubennorte rubennorte Oct 26, 2018

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Member Author

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

Copy link
Copy Markdown
Contributor

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

Comment thread packages/jest-util/src/fake_timers.js

@thymikee thymikee left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rubennorte rubennorte left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@github-actions

Copy link
Copy Markdown

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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants