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

@@ -422,6 +422,23 @@
/*--------------------------------------------------------------------------*/
QUnit.module('minified AMD snippet');
(function() {
var start = _.once(QUnit.start);
asyncTest('`lodash`', function() {
build(['-s'], function(source, filepath) {
// used by r.js build optimizer
var defineHasRegExp = /typeof\s+define\s*==(=)?\s*['"]function['"]\s*&&\s*typeof\s+define\.amd\s*==(=)?\s*['"]object['"]\s*&&\s*define\.amd/g;
ok(!!defineHasRegExp.exec(source));
start();
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('strict modifier');
(function() {