Skip to content

Commit 5dccf8a

Browse files
committed
Modified the tests.
1 parent ecb88c2 commit 5dccf8a

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

Sprint-2/implement/contains.test.js

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,29 +16,35 @@ as the object doesn't contains a key of 'c'
1616
// Given a contains function
1717
// When passed an object and a property name
1818
// Then it should return true if the object contains the property, false otherwise
19-
test("contains returns true for existing property");
20-
expect (contains({a: 1, b: 2}, 'a')).toBe(true);
19+
test("contains returns true for existing property", () => {
20+
expect(contains({a: 1, b: 2}, 'a')).toBe(true);
21+
});
2122

22-
test("contains returns false for non-existent property");
23-
expect (contains({a: 1, b: 2}, 'c')).toBe(false);
23+
test("contains returns false for non-existent property", () => {
24+
expect(contains({a: 1, b: 2}, 'c')).toBe(false);
25+
});
2426
// Given an empty object
2527
// When passed to contains
2628
// Then it should return false
27-
test("contains returns false for empty object");
28-
expect (contains({}, 'a')).toBe(false);
29+
test("contains returns false for empty object", () => {
30+
expect(contains({}, 'a')).toBe(false);
31+
});
2932

3033
// Given an object with properties
3134
// When passed to contains with an existing property name
3235
// Then it should return true
33-
test("contains returns true for existing property");
34-
expect (contains({a: 1, b: 2}, 'a')).toBe(true);
36+
test("contains returns true for existing property", () => {
37+
expect(contains({a: 1, b: 2}, 'a')).toBe(true);
38+
});
3539
// Given an object with properties
3640
// When passed to contains with a non-existent property name
3741
// Then it should return false
38-
test("contains returns false for non-existent property");
39-
expect (contains({a: 1, b: 2}, 'c')).toBe(false);
42+
test("contains returns false for non-existent property", () => {
43+
expect(contains({a: 1, b: 2}, 'c')).toBe(false);
44+
});
4045
// Given invalid parameters like an array
4146
// When passed to contains
4247
// Then it should return false or throw an error
43-
test("contains with invalid parameters returns false or throws error");
44-
expect (contains([1, 2, 3], 'a')).toBe(false);
48+
test("contains with invalid parameters returns false or throws error", () => {
49+
expect(contains([1, 2, 3], 'a')).toBe(false);
50+
});

0 commit comments

Comments
 (0)