Skip to content

Commit 3627c09

Browse files
committed
Update tests for null prototype objects
1 parent 597c374 commit 3627c09

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/basic.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,20 @@ test("replace object with other value", () => {
5555
]
5656
);
5757
});
58+
59+
test("equal null protype objects", () => {
60+
assert.deepStrictEqual(diff(Object.create(null), Object.create(null)), []);
61+
});
62+
63+
test("unequal null protype objects", () => {
64+
const obj1 = Object.create(null);
65+
const obj2 = Object.create(null);
66+
obj2.test = true;
67+
assert.deepStrictEqual(diff(obj1, obj2), [
68+
{
69+
type: "CREATE",
70+
path: ["test"],
71+
value: true,
72+
},
73+
]);
74+
});

0 commit comments

Comments
 (0)