Add doc not for chaining support in custom builds and tweak support rules in build.js. [closes #193]

Former-commit-id: c87f6bfe28f00d9228f4112463635d555e138a41
This commit is contained in:
John-David Dalton
2013-02-23 22:52:21 -08:00
parent 58d94ef61e
commit 324afd2d6c
7 changed files with 205 additions and 135 deletions

View File

@@ -1073,6 +1073,44 @@
/*--------------------------------------------------------------------------*/
QUnit.module('include command');
(function() {
var commands = [
'include=mixin',
'include=mixin,tap',
'include=mixin,value'
];
commands.forEach(function(command, index) {
asyncTest('`lodash ' + command +'`', function() {
var start = _.after(2, _.once(QUnit.start));
build(['-s', command], function(data) {
var basename = path.basename(data.outputPath, '.js'),
context = createContext(),
noop = function() {},
source = data.source;
vm.runInContext(data.source, context);
var lodash = context._;
lodash.mixin({ 'x': noop });
equal(lodash.x, noop, basename);
if (index) {
equal(typeof lodash.prototype.x, 'function', basename);
} else {
equal('x' in lodash.prototype.x, false, basename);
}
start();
});
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('output options');
(function() {