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

If setTimeout is overridden in an async test, ospec's timers can break, causing ospec to not actually report anything. #76

Open
dead-claudia opened this issue Oct 12, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dead-claudia
Copy link
Member

Steps:

  1. In either a o.beforeEach callback or synchronously in a promise-returning test body, override setTimeout to capture its body.
  2. In the test body, asynchronously invoke the callback at some point.
  3. Restore the callback either at the end of a test or in an o.afterEach callback.

Unfortunately, I don't have a handy test case for this at the moment, but it should be possible to piece one together pretty easily.

Had to work around this by using timers directly.

@dead-claudia dead-claudia added the bug Something isn't working label Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant