Add "underscore" build test.

Former-commit-id: 8050e285fae94c96e7db1c8847ace45ae5cade33
This commit is contained in:
John-David Dalton
2012-09-08 19:26:43 -07:00
parent 24825b42a2
commit 57a990ce25
2 changed files with 71 additions and 47 deletions

View File

@@ -444,7 +444,7 @@
);
commands.forEach(function(command) {
var start = _.after(2, QUnit.start);
var start = _.after(2, _.once(QUnit.start));
asyncTest('`lodash ' + command +'`', function() {
build(['--silent'].concat(command.split(' ')), function(filepath, source) {
@@ -520,6 +520,8 @@
});
['non-strict', 'strict'].forEach(function(strictMode, index) {
var start = _.after(2, _.once(QUnit.start));
asyncTest(strictMode + ' should ' + (index ? 'error': 'silently fail') + ' attempting to overwrite read-only properties', function() {
var commands = ['--silent', 'include=bindAll,defaults,extend'];
if (index) {
@@ -546,4 +548,26 @@
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('underscore modifier');
(function() {
var start = _.once(QUnit.start);
asyncTest('should not have deep clone', function() {
build(['--silent', 'underscore'], function(filepath, source) {
vm.runInContext(source, context);
var array = [{ 'a': 1 }],
basename = path.basename(filepath, '.js'),
lodash = context._;
ok(lodash.clone(array, true)[0] === array[0], basename);
start();
});
});
}());
}());