2 if (typeof QUnit !== 'undefined'){
3 var QUnitAutostart = (QUnit.config.autostart === undefined) ? true : QUnit.config.autostart;
5 //check to make sure requirejs is completed before we start the test runner
6 var allLoaded = function() {
7 return window.QUnit.config.queue.length > 0 && blanket.noConflict().requireFilesLoaded();
10 function shouldAutoStart() {
11 return !(blanket.options("existingRequireJS") && !blanket.options("autoStart")) && QUnitAutostart;
14 if (!QUnit.config.urlConfig[0].tooltip){
15 //older versions we run coverage automatically
16 //and we change how events are binded
17 QUnit.begin=function(){
18 blanket.noConflict().setupCoverage();
21 QUnit.done=function(failures, total) {
22 blanket.noConflict().onTestsDone();
24 QUnit.moduleStart=function( details ) {
25 blanket.noConflict().onModuleStart();
27 QUnit.testStart=function( details ) {
28 blanket.noConflict().onTestStart();
30 QUnit.testDone=function( details ) {
31 blanket.noConflict().onTestDone(details.total,details.passed);
33 blanket.beforeStartTestRunner({
38 QUnit.config.urlConfig.push({
40 label: "Enable coverage",
41 tooltip: "Enable code coverage."
44 if ( QUnit.urlParams.coverage || blanket.options("autoStart") ) {
45 QUnit.config.autostart = false;
46 QUnit.begin(function(){
47 blanket.noConflict().setupCoverage();
50 QUnit.done(function(failures, total) {
51 blanket.noConflict().onTestsDone();
53 QUnit.moduleStart(function( details ) {
54 blanket.noConflict().onModuleStart();
56 QUnit.testStart(function( details ) {
57 blanket.noConflict().onTestStart();
59 QUnit.testDone(function( details ) {
60 blanket.noConflict().onTestDone(details.total,details.passed);
62 blanket.noConflict().beforeStartTestRunner({
65 if (shouldAutoStart()){