mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Add test for mergeWith with multi-ref source object.
This commit is contained in:
committed by
John-David Dalton
parent
0b76654b71
commit
bbd536fc04
14
test/test.js
14
test/test.js
@@ -14386,6 +14386,20 @@
|
||||
|
||||
assert.deepEqual(actual, { 'a': { 'b': ['c'] } });
|
||||
});
|
||||
|
||||
QUnit.test('should pop the stack of sources for each sibling property', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var array = ['b', 'c'],
|
||||
object = { 'a': ['a'] },
|
||||
source = { 'a': array, 'b': array };
|
||||
|
||||
var actual = _.mergeWith(object, source, function(a, b) {
|
||||
return lodashStable.isArray(a) ? a.concat(b) : undefined;
|
||||
});
|
||||
|
||||
assert.deepEqual(actual, { 'a': ['a', 'b', 'c'], 'b': ['b', 'c'] });
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user