Skip to content

Commit

Permalink
Added test for extending array with undefined or null elements.
Browse files Browse the repository at this point in the history
  • Loading branch information
eriksunsol committed Aug 7, 2019
1 parent e0592b6 commit 7cf32fd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/spec/proxySpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -740,6 +740,26 @@ describe('proxy', function() {
]);
expect(genereatedPatches).toReallyEqual(comparedPatches);
});
it('Array extended with `null` or `undefined` element', function () {
var objFactory = function() {
return {
arr: Array(5)
};
};

var objChanger = function(obj) {
obj.arr[7];
obj.arr[7] = null;
obj.arr[8] = undefined;
};

var genereatedPatches = getPatchesUsingGenerate(
objFactory,
objChanger
);
var comparedPatches = getPatchesUsingCompare(objFactory, objChanger);
expect(genereatedPatches).toReallyEqual(comparedPatches);
});
});

describe('should generate remove, when', function() {
Expand Down

0 comments on commit 7cf32fd

Please sign in to comment.