Skip to content

Commit 48e7175

Browse files
committed
Add new test that is broken on the current version
1 parent 9166566 commit 48e7175

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ describe('.mixinDeep()', function() {
3636
assert.notDeepEqual(actual, obj3);
3737
});
3838

39+
it('should copy properties onto the first object without modifying other sub-objects', function() {
40+
const obj1 = { x: { a: 0, b: 1 } };
41+
const obj2 = { x: { c: 2, d: 3 } };
42+
const obj3 = { x: { a: 4, d: 5 } };
43+
44+
const actual = { x: { a: 4, b: 1, c: 2, d: 5 } };
45+
46+
assert.deepEqual(mixinDeep({}, obj1, obj2, obj3), actual);
47+
assert.notDeepEqual(actual, obj1);
48+
assert.notDeepEqual(actual, obj2);
49+
assert.notDeepEqual(actual, obj3);
50+
});
51+
3952
it('should mixin nested object properties', function() {
4053
const obj1 = { a: { b: 1, c: 1, d: { e: 1, f: 1 } } };
4154
const obj2 = { a: { b: 2, d: { f: 'f' } } };
@@ -79,7 +92,7 @@ describe('.mixinDeep()', function() {
7992

8093
const actual = mixinDeep({}, obj1, obj2);
8194
assert.deepEqual(actual, { a: { b: 1, c: 2 } });
82-
assert.deepEqual(actual.a, obj1.a);
95+
assert.notDeepEqual(actual.a, obj1.a);
8396
assert.notDeepEqual(actual.a, obj2.a);
8497
});
8598

0 commit comments

Comments
 (0)