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

TimestampProviders and TestScheduler "run mode" #5475

Closed
benlesh opened this issue Jun 9, 2020 · 2 comments
Closed

TimestampProviders and TestScheduler "run mode" #5475

benlesh opened this issue Jun 9, 2020 · 2 comments
Assignees

Comments

@benlesh
Copy link
Member

benlesh commented Jun 9, 2020

Currently, TestScheduler "run mode" will patch all schedulers by default. This means that everywhere we were only using schedulers as TimestampProviders, will use the test scheduler's currently time when now() is called.

However... we're going to be breaking people's tests with a move to use Date or performance as default TimestampProviders.

I see two solutions:

  1. Have TestScheduler temporarily monkey patch Date.now and performance.now to accommodate bare uses of things like animationFrames, etc.
  2. Create very, very light wrappers around Date.now and Performance.now that are used internally (but not exported, yet) that we monkey patch when we are in run mode.

I'm inclined to say that #2 is the best answer, and the least likely to break others.

@benlesh benlesh added the AGENDA ITEM Flagged for discussion at core team meetings label Jun 9, 2020
@benlesh
Copy link
Member Author

benlesh commented Jun 17, 2020

Core team picks option 2.

@cartant
Copy link
Collaborator

cartant commented Feb 28, 2021

Pretty sure this is closed by #5607.

@cartant cartant closed this as completed Feb 28, 2021
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