mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Add ui.isForeign, add guards for Worker tests, and remove Dojo loader filter from test.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
addEventListener('message', function(e) {
|
||||
if (e.data) {
|
||||
importScripts('../' + e.data);
|
||||
try {
|
||||
importScripts('../' + e.data);
|
||||
} catch(e) {
|
||||
self._ = {};
|
||||
}
|
||||
postMessage(_.VERSION);
|
||||
}
|
||||
}, false);
|
||||
|
||||
Reference in New Issue
Block a user