Add _.extend and _.defaults underscore build tests.

Former-commit-id: f9244ddd7c81f65d2f0a01a18fa6e821e8f2705b
This commit is contained in:
John-David Dalton
2013-02-13 02:49:12 -08:00
parent 958d4dbd2e
commit 997c43bbdd

View File

@@ -763,9 +763,18 @@
function Foo() {}
Foo.prototype = { 'a': 1 };
actual = lodash.defaults({ 'a': null }, { 'a': 1 });
strictEqual(actual.a, 1, '_.defaults should overwrite `null` values: ' + basename);
deepEqual(lodash.defaults({}, new Foo), Foo.prototype, '_.defaults should assign inherited `source` properties: ' + basename);
deepEqual(lodash.extend({}, new Foo), Foo.prototype, '_.extend should assign inherited `source` properties: ' + basename);
actual = lodash.extend({}, { 'a': 0 }, function(a, b) {
return this[b];
}, [2]);
strictEqual(actual.a, 0, '_.extend should ignore `callback` and `thisArg`: ' + basename);
actual = lodash.find(array, function(value) {
return 'a' in value;
});