mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Update test files to work with underscore builds defined as named amd modules.
This commit is contained in:
@@ -186,7 +186,7 @@
|
|||||||
var reBasename = /[\w.-]+$/,
|
var reBasename = /[\w.-]+$/,
|
||||||
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
|
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
|
||||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||||
locationPath = modulePath.replace(reBasename, '').replace(/\/$/, ''),
|
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
|
||||||
moduleMain = modulePath.match(reBasename)[0],
|
moduleMain = modulePath.match(reBasename)[0],
|
||||||
uid = +new Date;
|
uid = +new Date;
|
||||||
|
|
||||||
|
|||||||
@@ -143,18 +143,21 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var reBasename = /[\w.-]+$/,
|
var reBasename = /[\w.-]+$/,
|
||||||
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
|
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
|
||||||
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
modulePath = ui.buildPath.replace(/\.js$/, ''),
|
||||||
locationPath = modulePath.replace(reBasename, '').replace(/\/$/, ''),
|
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
|
||||||
moduleMain = modulePath.match(reBasename)[0];
|
moduleId = /\bunderscore\b/.test(ui.buildPath) ? 'underscore' : 'lodash',
|
||||||
|
moduleMain = modulePath.match(reBasename)[0],
|
||||||
|
uid = +new Date;
|
||||||
|
|
||||||
function getConfig() {
|
function getConfig() {
|
||||||
return {
|
return {
|
||||||
'baseUrl': './',
|
'baseUrl': './',
|
||||||
'urlArgs': 't=' + (+new Date),
|
'urlArgs': 't=' + uid++,
|
||||||
|
'waitSeconds': 0,
|
||||||
'packages': [
|
'packages': [
|
||||||
{
|
{
|
||||||
'name': 'lodash',
|
'name': moduleId,
|
||||||
'location': locationPath,
|
'location': locationPath,
|
||||||
'main': moduleMain
|
'main': moduleMain
|
||||||
},
|
},
|
||||||
@@ -174,7 +177,7 @@
|
|||||||
QUnit.config.autostart = false;
|
QUnit.config.autostart = false;
|
||||||
|
|
||||||
// load Lo-Dash as a module
|
// load Lo-Dash as a module
|
||||||
require(getConfig(), ['lodash'], function(lodash) {
|
require(getConfig(), [moduleId], function(lodash) {
|
||||||
if (ui.isModularize) {
|
if (ui.isModularize) {
|
||||||
window._ = lodash;
|
window._ = lodash;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user