Skip to content

Commit

Permalink
Update tests for null prototype objects
Browse files Browse the repository at this point in the history
  • Loading branch information
AsyncBanana committed Apr 14, 2023
1 parent 597c374 commit 3627c09
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,20 @@ test("replace object with other value", () => {
]
);
});

test("equal null protype objects", () => {
assert.deepStrictEqual(diff(Object.create(null), Object.create(null)), []);
});

test("unequal null protype objects", () => {
const obj1 = Object.create(null);
const obj2 = Object.create(null);
obj2.test = true;
assert.deepStrictEqual(diff(obj1, obj2), [
{
type: "CREATE",
path: ["test"],
value: true,
},
]);
});

0 comments on commit 3627c09

Please sign in to comment.