Add ui.isForeign, add guards for Worker tests, and remove Dojo loader filter from test.

This commit is contained in:
John-David Dalton
2014-05-11 16:02:48 -07:00
parent d5c3b258f3
commit 0f8c20c3ab
4 changed files with 26 additions and 19 deletions

View File

@@ -128,6 +128,15 @@
init();
});
// used to indicate testing a foreign file
ui.isForeign = RegExp('^(\\w+:)?//').test(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]);
// used to indicate testing in Sauce Labs' automated test cloud
ui.isSauceLabs = location.port == '9001';
// expose Lo-Dash build file path
ui.buildPath = (function() {
var result;
@@ -170,12 +179,6 @@
'loadEventEnd': 0
};
// 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]);
// used to indicate testing in Sauce Labs' automated test cloud
ui.isSauceLabs = location.port == '9001';
// expose `ui`
window.ui = ui;

View File

@@ -1,6 +1,10 @@
addEventListener('message', function(e) {
if (e.data) {
importScripts('../' + e.data);
try {
importScripts('../' + e.data);
} catch(e) {
self._ = {};
}
postMessage(_.VERSION);
}
}, false);