Closed e0da closed 9 years ago
Thanks for the PR, @justinforce! I'll take a closer look at this sometime soon, but I figured I'd leave a note for myself (or anyone else) here: these sorts of tests are exactly what sinon's fake timer is perfect at simulating.
@justinforce, do you think that #119 does a more precise job at being deterministic about this? It's overriding the browser's internal timer to be exact in its counting.
closing thing in favor of #119
If you set your interval to 100 as the problem prompts, then at exactly 200, it's very likely that you will still have exactly 1 item in
nums
when the expectation is evaluated. Bump the test timeout to 250, and the behavior is much more deterministic.