-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fake "timers/promise" module #469
Labels
Comments
haphut
added a commit
to HSLdevcom/transitdata-partial-apc-expander-combiner
that referenced
this issue
Dec 13, 2023
Unfortunately jest cannot currently handle mocking setTimeout from "node:timers/promises", see issue sinonjs/fake-timers#469 . We do not wish to mix callbacks and async functions. To keep our code testable with jest, let's create our own cancellable wrapper around the callback-based setTimeout.
haphut
added a commit
to HSLdevcom/transitdata-partial-apc-expander-combiner
that referenced
this issue
Dec 13, 2023
Unfortunately jest cannot currently handle mocking setTimeout from "node:timers/promises", see issue sinonjs/fake-timers#469 . We do not wish to mix callbacks and async functions. To keep our code testable with jest, let's create our own cancellable wrapper around the callback-based setTimeout.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Not stale |
This can be closed 🎉 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In #467 @swenzel-arc added the support for the
timers
module in NodeJS. Node also exports a non-callback async/Promise version of that API that needs a fake implementation. We can probably very easily piggy-pack on top of the existing work done in the referenced PR.Also see the over-arching #418
The text was updated successfully, but these errors were encountered: