Update test files to work with underscore builds defined as named amd modules.

This commit is contained in:
John-David Dalton
2014-02-15 01:17:00 -08:00
parent 7edf024c71
commit 8a25592904
2 changed files with 10 additions and 7 deletions

View File

@@ -186,7 +186,7 @@
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, '').replace(/\/$/, ''),
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
moduleMain = modulePath.match(reBasename)[0],
uid = +new Date;

View File

@@ -143,18 +143,21 @@
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, '').replace(/\/$/, ''),
moduleMain = modulePath.match(reBasename)[0];
locationPath = modulePath.replace(reBasename, '').replace(/^\/|\/$/g, ''),
moduleId = /\bunderscore\b/.test(ui.buildPath) ? 'underscore' : 'lodash',
moduleMain = modulePath.match(reBasename)[0],
uid = +new Date;
function getConfig() {
return {
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'urlArgs': 't=' + uid++,
'waitSeconds': 0,
'packages': [
{
'name': 'lodash',
'name': moduleId,
'location': locationPath,
'main': moduleMain
},
@@ -174,7 +177,7 @@
QUnit.config.autostart = false;
// load Lo-Dash as a module
require(getConfig(), ['lodash'], function(lodash) {
require(getConfig(), [moduleId], function(lodash) {
if (ui.isModularize) {
window._ = lodash;
}