Using a setTimeout stub can stop test suite from continuing #432

Closed
qxjit opened this Issue Mar 25, 2013 · 0 comments

Projects

None yet

1 participant

Contributor
qxjit commented Mar 25, 2013

If you replace the global setTimeout function with a stub (like sinon's useFakeTimers), it can permanently stop the test suite.

When QUnit stops processing the queue to let the browser update, it calls the global setTimeout to schedule the next block of queue processing. If you are unlucky the test currently running may have stubbed setTimeout and its teardown step could still be on queue waiting to run. In this case, QUnit will end up using the stubbed setTimeout instead of the real one, and the entire test suite will stop running.

@Krinkle Krinkle added a commit that referenced this issue May 14, 2013
@Krinkle Krinkle Revert "Fixes #432 - Using a setTimeout stub can stop test suite from…
… continuing - closes gh-433"

This reverts commit cf41077.
b56ea44
@jzaefferer jzaefferer added a commit that referenced this issue Jun 4, 2013
@qxjit @jzaefferer qxjit + jzaefferer Use a local setTimeout reference, add separate unit test suite for th…
…at. Fixes #432 - Using a setTimeout stub can stop test suite from continuing. Closes gh-433
4e62b4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment