QUnit has a number of callbacks, such as:
QUnit.done()
QUnit.moduleDone()
QUnit.testDone()
The problem is that QUnit.done()
does not work as expected. It actually fires after each test. Is this expected behaviour?
I register all tests into QUnit once the page is loaded (with jQuery) as like below since they (unfortunately) depend on the app being loaded first. And they are split among multiple handlers so tests can be put in different files.
$(function(){
QUnit.module( "Module 1" );
QUnit.test("Test 1", function( assert ){
assert.ok(true);
});
});
});
$(function(){
QUnit.module( "Module 2" );
QUnit.test("Test 2", function( assert ){
assert.ok(true);
});
});
});
Would this be the reason for done()
being called after each test? Is there any way around this, besides having all tests in one file?