Steps:
- In either a
o.beforeEach callback or synchronously in a promise-returning test body, override setTimeout to capture its body.
- In the test body, asynchronously invoke the callback at some point.
- 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.