Restrict script load error excusal a bit.

This commit is contained in:
John-David Dalton
2014-05-03 07:55:11 -07:00
parent e3f94156f1
commit 0f8db11f53
4 changed files with 24 additions and 6 deletions

View File

@@ -176,10 +176,13 @@
if (!window.require) {
return;
}
// avoid reporting tests to Sauce Labs when errors occur
// avoid reporting tests to Sauce Labs when script load errors occur
if (ui.isSauceLabs) {
window.onerror = function() {
QUnit.config.done.length = 0;
var loadEventEnd = ui.timing.loadEventEnd;
if (loadEventEnd && (new Date - loadEventEnd > 5000)) {
QUnit.config.done.length = 0;
}
};
}
var reBasename = /[\w.-]+$/,