Skip to content
This repository has been archived by the owner on Mar 28, 2018. It is now read-only.

async tests never continue #3

Closed
absoludity opened this issue Mar 30, 2012 · 4 comments
Closed

async tests never continue #3

absoludity opened this issue Mar 30, 2012 · 4 comments

Comments

@absoludity
Copy link

If I create a simple test module using the example async test:

module("Test async");

asyncTest("a test", function() {
  setTimeout(function(){
    ok(true, "always fine");
    start();
  }, 13);
});

saved as test/test_qunit.js and included in my html like this: http://paste.ubuntu.com/906759/

then the start() is never called and the test runner never completes. If I remove sinon-qunit from my html (line 8), the test completes as expected.

@cjohansen
Copy link
Owner

The problem is that the qunit-sinon adapter configures Sinon to fake timers by default. Disable by saying this.clock.restore() in a single test, or sinon.config.useFakeTimers = false before all tests

@trcarden
Copy link

Uhm this got me too. Can this be mentioned in the docs or perhaps a nonbreaking default for the adapter?

Docs here don't seem to mention that by default the adapter breaks qunit asyncTests.
http://sinonjs.org/qunit/

@kylegibson
Copy link

This was frustrating to debug.

@cjohansen
Copy link
Owner

I don't use QUnit, so if someone using it has better suggestions for defaults etc, feel free to submit a PR!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants