Add test for mergeWith with multi-ref source object.

This commit is contained in:
Danny Fallon
2016-02-26 14:14:32 +00:00
committed by John-David Dalton
parent 0b76654b71
commit bbd536fc04

View File

@@ -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'] });
});
}());
/*--------------------------------------------------------------------------*/