We got a bug report our way in sinonjs/lolex#66, which basically boils down to that tape ends up using stubbed timing functions and gets stuck. Mocha solves this issue by saving references to all global timing related functions, such as setTimeout, setInterval, nextTick, ..., so that later modifications will not interfere with its internal use of them.
This would be the easiest fix.
Relevant lines that uses nextTick:
Yeah, seems like a reasonable way of resolving this - though one might also argue that clocks should never be messed with. But it probably has its uses, so hey
See Also:
Absolutely tape should be robust against modification of globals - thanks for the report!
Please file one on through for https://github.com/dominictarr/through/commit/903501acf73d03f584dd572b885c78c1bc9cca8b#diff-168726dbe96b3ce427e7fedce31bb0bcR49 - that's a separate repo.
Your given example though is indeed a cached version of process.nextTick - there's one example of setTimeout in tape code, which I'll fix shortly.
Most helpful comment
Absolutely
tapeshould be robust against modification of globals - thanks for the report!Please file one on
throughfor https://github.com/dominictarr/through/commit/903501acf73d03f584dd572b885c78c1bc9cca8b#diff-168726dbe96b3ce427e7fedce31bb0bcR49 - that's a separate repo.Your given example though is indeed a cached version of
process.nextTick- there's one example ofsetTimeoutintapecode, which I'll fix shortly.