-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Support sinon fake timers #1187
Comments
Alternatively, flush the queue without using |
This would be great, jest fake timers are supported in RTL, but sinon fake times are widely used. We can't build a few scenarios due to this limitation at the moment. |
5 tasks
Use this snippet if you only want the current time to be faked sinon.useFakeTimers({
now: (new Date(2024, 7, 21)).getTime(),
toFake: ['Date'],
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the feature you'd like:
When using
waitFor
and sinon fake timers enabled, the test gets stuck and eventually times out. This seems to be a consequence of f78839b which adds asetTimeout
.Suggested implementation:
Supporting it in the same way jest timers are supported is probably okay, alternatively provide configuration for generically supporting arbitrary fake timer implementations.
Describe alternatives you've considered:
Adding the following to our test setup seems to work with the current version but it could easily get out of sync and it would be nice to have it built in or provide nicer abstraction to configure.
Teachability, Documentation, Adoption, Migration Strategy:
Ideally, it should just work. Otherwise, examples for how to configure it would be nice.
The text was updated successfully, but these errors were encountered: