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

refactor(fake-timers): don't setup fakeTimerAPIs unless needed #10551

Conversation

@tgriesser
Copy link
Contributor

@tgriesser tgriesser commented Sep 23, 2020

Summary

Noticed that the mock fn's for the legacy fake timers are created immediately, even if they're never used. Since _createMocks is called in useFakeTimers, it seems we should be able to remove this from the constructor and only set them up if needed.

Test plan

No functional change, existing tests should pass

@SimenB
SimenB approved these changes Sep 27, 2020
Copy link
Collaborator

@SimenB SimenB left a comment

Thanks! Mind adding a changelog entry?

SimenB added 3 commits Oct 19, 2020
@SimenB SimenB merged commit ecb31a7 into facebook:master Oct 19, 2020
22 checks passed
22 checks passed
cleanup-runs
Details
Running TypeScript compiler & ESLint
Details
Node v10.x on ubuntu-latest
Details
Node v10.x on macOS-latest
Details
Node v10.x on windows-latest
Details
Node v12.x on ubuntu-latest
Details
Node v12.x on macOS-latest
Details
Node v12.x on windows-latest
Details
Node v13.x on ubuntu-latest
Details
Node v13.x on macOS-latest
Details
Node v13.x on windows-latest
Details
Node v14.x on ubuntu-latest
Details
Node v14.x on macOS-latest
Details
Node v14.x on windows-latest
Details
Facebook CLA Check Contributor License Agreement is valid!
Details
ci/circleci: test-jest-circus Your tests passed on CircleCI!
Details
ci/circleci: test-node-10 Your tests passed on CircleCI!
Details
ci/circleci: test-node-12 Your tests passed on CircleCI!
Details
ci/circleci: test-node-13 Your tests passed on CircleCI!
Details
ci/circleci: test-node-14 Your tests passed on CircleCI!
Details
ci/circleci: test-or-deploy-website Your tests passed on CircleCI!
Details
facebook.jest #20201019.2 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.