Add RequireJS "shim" test and a build test to ensure the AMD snippet is maintained for r.js.

Former-commit-id: 708c07877cfca0022d6d56c16c36d8bae79e4796
This commit is contained in:
John-David Dalton
2012-09-13 19:11:48 -07:00
parent 827091e522
commit 08249d78ea
3 changed files with 38 additions and 2 deletions

View File

@@ -44,6 +44,7 @@
<script>
// load Lo-Dash as a module
var lodashModule,
shimmedModule,
underscoreModule;
window.require && require({
@@ -51,14 +52,24 @@
'urlArgs': 't=' + (+new Date),
'paths': {
'lodash': '../../' + QUnit.config.lodashFilename,
'underscore': './../../' + QUnit.config.lodashFilename
'shimmed': './../../' + QUnit.config.lodashFilename,
'underscore': '../underscore/../../' + QUnit.config.lodashFilename
},
'shim': {
'shimmed': {
'exports': '_'
}
}
},
['lodash', 'underscore'], function(lodash, underscore) {
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
if (lodash.noConflict) {
lodashModule = lodash.noConflict();
lodashModule.moduleName = 'lodash';
}
if (shimmed.noConflict) {
shimmedModule = shimmed.noConflict();
shimmedModule.moduleName = 'shimmed';
}
if (underscore.noConflict) {
underscoreModule = underscore.noConflict();
underscoreModule.moduleName = 'underscore';