diff --git a/test/index.html b/test/index.html
index ce43f99ea..76190b887 100644
--- a/test/index.html
+++ b/test/index.html
@@ -196,8 +196,6 @@
moduleMain = modulePath.match(reBasename)[0],
uid = +new Date;
- QUnit.config.autostart = false;
-
function getConfig() {
return {
'baseUrl': './',
@@ -239,7 +237,7 @@
}
function loadTests() {
- require(['test'], function() {
+ require(getConfig(), ['test'], function() {
QUnit.start();
});
}
@@ -264,7 +262,7 @@
window._ = lodash;
}
if (ui.isModularize) {
- require(['lodash/internals/baseEach'], function(baseEach) {
+ require(getConfig(), ['lodash/internals/baseEach'], function(baseEach) {
lodash._baseEach = baseEach;
loadTests();
});
@@ -273,6 +271,9 @@
}
});
}
+
+ QUnit.config.autostart = false;
+
if (window.requirejs) {
addBizarroMethods();
require(getConfig(), ['lodash'], function(lodash) {
diff --git a/test/underscore.html b/test/underscore.html
index 65e41f0ce..c2832cde8 100644
--- a/test/underscore.html
+++ b/test/underscore.html
@@ -155,34 +155,37 @@
locationPath = modulePath.replace(reBasename, '').replace(/\/$/, ''),
moduleMain = modulePath.match(reBasename)[0];
+ function getConfig() {
+ return {
+ 'baseUrl': './',
+ 'urlArgs': 't=' + (+new Date),
+ 'packages': [
+ {
+ 'name': 'lodash',
+ 'location': locationPath,
+ 'main': moduleMain
+ },
+ {
+ 'name': 'test',
+ 'location': '../vendor/underscore/test',
+ 'config': {
+ // work around no global being exported
+ 'exports': 'QUnit',
+ 'loader': 'curl/loader/legacy'
+ }
+ }
+ ]
+ };
+ }
+
QUnit.config.autostart = false;
// load Lo-Dash as a module
- require({
- 'baseUrl': './',
- 'urlArgs': 't=' + (+new Date),
- 'packages': [
- {
- 'name': 'lodash',
- 'location': locationPath,
- 'main': moduleMain
- },
- {
- 'name': 'test',
- 'location': '../vendor/underscore/test',
- 'config': {
- // work around no global being exported
- 'exports': 'QUnit',
- 'loader': 'curl/loader/legacy'
- }
- }
- ]
- },
- ['lodash'], function(lodash) {
+ require(getConfig(), ['lodash'], function(lodash) {
if (ui.isModularize) {
window._ = lodash;
}
- require([
+ require(getConfig(), [
'test/collections',
'test/arrays',
'test/functions',