Cleanup throbber interval in vendor/qunit-extras.

This commit is contained in:
John-David Dalton
2014-04-25 17:41:40 -07:00
parent 3d6c74ead1
commit aea4d73e61

View File

@@ -180,8 +180,7 @@
var isWindows = /win/i.test(os);
/** Used to display the wait throbber */
var throbberId,
throbberDelay = 500,
var throbberDelay = 500,
waitCount = -1;
/** Shorten `context.QUnit.QUnit` to `context.QUnit` */
@@ -495,11 +494,6 @@
moduleName = newModuleName;
modulePrinted = false;
}
// initialize the wait throbber
if (!throbberId) {
throbberId = context.setInterval(logThrobber, throbberDelay);
logThrobber();
}
});
// add a callback to be triggered after a test is completed
@@ -606,9 +600,6 @@
}());
} catch(e) { }
// add `console.log` support to Narwhal, Rhino, and RingoJS
console || (console = context.console = { 'log': context.print });
// expose shortcuts
// exclude `module` because some environments have it as a built-in object
('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' +
@@ -616,6 +607,14 @@
context[methodName] = QUnit[methodName];
});
// add `console.log` support to Narwhal, Rhino, and RingoJS
if (!console) {
console = context.console = { 'log': context.print };
}
// start log throbber
if (!isSilent) {
context.setInterval(logThrobber, throbberDelay);
}
// must call `QUnit.start` in the test file if not loaded in a browser
QUnit.config.autostart = false;
QUnit.init();