Skip to content

Commit 47c562d

Browse files
authored
Update contains.test.js
1 parent 91fc572 commit 47c562d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎Sprint-2/implement/contains.test.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ test("returns false when object does not contain the property", () => {
3838
expect(contains({ a: 1, b: 2 }, "c")).toBe(false);
3939
});
4040

41+
// Given an object that inherits from Object.prototype
42+
// When checking for an inherited property like toString
43+
// Then it should return false because it is not an own property
44+
test("returns false for inherited properties like toString", () => {
45+
expect(contains({}, "toString")).toBe(false);
46+
});
47+
4148
// Given invalid parameters like an array
4249
// When passed to contains
4350
// Then it should return false or throw an error

0 commit comments

Comments
 (0)