mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 02:17:48 +00:00
Add _.extend and _.defaults underscore build tests.
Former-commit-id: f9244ddd7c81f65d2f0a01a18fa6e821e8f2705b
This commit is contained in:
@@ -763,9 +763,18 @@
|
|||||||
function Foo() {}
|
function Foo() {}
|
||||||
Foo.prototype = { 'a': 1 };
|
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.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);
|
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) {
|
actual = lodash.find(array, function(value) {
|
||||||
return 'a' in value;
|
return 'a' in value;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user