What should be the general things we want to happen with timers in tests?
- Recommend against using timers if at all possible. (Obviously, if the test is specifically testing timers, then using them is fine.)
- Do we distinguish between
setTimeout(), setImmediate(), and process.nextTick()? I think only setTimeout() is generally problematic. The other two are usually fine.
- Tests that rely on timers should go in
sequential and not in parallel.
What else?
What should be the general things we want to happen with timers in tests?
setTimeout(),setImmediate(), andprocess.nextTick()? I think onlysetTimeout()is generally problematic. The other two are usually fine.sequentialand not inparallel.What else?