mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Avoid loading lodash when not needed in unit tests.
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
global_test_results = results;
|
global_test_results = results;
|
||||||
});
|
});
|
||||||
|
|
||||||
// load Lo-Dash again to overwrite the existing `_` value
|
// load the build of Lo-Dash
|
||||||
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -82,9 +82,13 @@
|
|||||||
global_test_results = results;
|
global_test_results = results;
|
||||||
});
|
});
|
||||||
|
|
||||||
// load Lo-Dash again to overwrite the existing `_` value
|
// clear existing `_` value
|
||||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
var _ = undefined;
|
||||||
|
|
||||||
|
// load the non-modularized build of Lo-Dash
|
||||||
|
if (!ui.isModularize) {
|
||||||
|
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||||
|
}
|
||||||
// load test.js if not using require.js
|
// load test.js if not using require.js
|
||||||
document.write(ui.urlParams.loader == 'none'
|
document.write(ui.urlParams.loader == 'none'
|
||||||
? '<script src="test.js"><\/script>'
|
? '<script src="test.js"><\/script>'
|
||||||
|
|||||||
@@ -110,9 +110,10 @@
|
|||||||
global_test_results = results;
|
global_test_results = results;
|
||||||
});
|
});
|
||||||
|
|
||||||
// load Lo-Dash again to overwrite the existing `_` value
|
// load the non-modularized build of Lo-Dash
|
||||||
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
|
if (!ui.isModularize) {
|
||||||
|
document.write('<script src="' + ui.buildPath + '"><\/script>');
|
||||||
|
}
|
||||||
// load test.js if not using require.js
|
// load test.js if not using require.js
|
||||||
document.write(ui.urlParams.loader != 'none'
|
document.write(ui.urlParams.loader != 'none'
|
||||||
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
|
||||||
|
|||||||
Reference in New Issue
Block a user