Skip to content

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

Description

@dead-claudia

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions