Оберните все ваши тесты внутри функции.
Вызовите функцию, когда будете готовы к запуску теста.
Если вы хотите перезапустить тест после завершения QUnit, создайте и вызовите функцию, подобную 'rerunQUnitTest'.
var runAllTest = function(){
test( "test 1", function(){
var a = true;
equal( a, true, "function a should return false" );
});
};
// call rerunQUnitTest to reset and run your tests again.
var rerunQUnitTest = function(){
QUnit.reset(); // should clear the DOM
QUnit.init(); // resets the qunit test environment
QUnit.start(); // allows for the new test to be captured.
runAllTest(); // runs your functions that has all the test wrapped inside.
};
runAllTest(); // auto runs your tests.