mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Restrict script load error excusal a bit.
This commit is contained in:
@@ -121,6 +121,10 @@
|
|||||||
var buildList = span1.lastChild,
|
var buildList = span1.lastChild,
|
||||||
loaderList = span2.lastChild;
|
loaderList = span2.lastChild;
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
ui.timing.loadEventEnd = +new Date;
|
||||||
|
}, 1);
|
||||||
|
|
||||||
init();
|
init();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -161,6 +165,11 @@
|
|||||||
'loader': loader
|
'loader': loader
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// expose page load timestamps
|
||||||
|
ui.timing = {
|
||||||
|
'loadEventEnd': 0
|
||||||
|
};
|
||||||
|
|
||||||
// used to indicate testing a modularized build
|
// used to indicate testing a modularized build
|
||||||
ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|node)|modularize|npm)\b/.test([location.pathname, location.search, ui.buildPath]);
|
ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|node)|modularize|npm)\b/.test([location.pathname, location.search, ui.buildPath]);
|
||||||
|
|
||||||
|
|||||||
@@ -64,10 +64,13 @@
|
|||||||
mixinPrereqs(_);
|
mixinPrereqs(_);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// avoid reporting tests to Sauce Labs when errors occur
|
// avoid reporting tests to Sauce Labs when script load errors occur
|
||||||
if (ui.isSauceLabs) {
|
if (ui.isSauceLabs) {
|
||||||
window.onerror = function() {
|
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.-]+$/,
|
var reBasename = /[\w.-]+$/,
|
||||||
|
|||||||
@@ -185,10 +185,13 @@
|
|||||||
if (!window.require) {
|
if (!window.require) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// avoid reporting tests to Sauce Labs when errors occur
|
// avoid reporting tests to Sauce Labs when script load errors occur
|
||||||
if (ui.isSauceLabs) {
|
if (ui.isSauceLabs) {
|
||||||
window.onerror = function() {
|
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.-]+$/,
|
var reBasename = /[\w.-]+$/,
|
||||||
|
|||||||
@@ -176,10 +176,13 @@
|
|||||||
if (!window.require) {
|
if (!window.require) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// avoid reporting tests to Sauce Labs when errors occur
|
// avoid reporting tests to Sauce Labs when script load errors occur
|
||||||
if (ui.isSauceLabs) {
|
if (ui.isSauceLabs) {
|
||||||
window.onerror = function() {
|
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.-]+$/,
|
var reBasename = /[\w.-]+$/,
|
||||||
|
|||||||
Reference in New Issue
Block a user