Skip to content

Commit 5201774

Browse files
committed
Add test for empty array case in max function
1 parent 25d86f0 commit 5201774

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎Sprint-1/implement/max.test.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ const findMax = require("./max.js");
1616
// When passed to the max function
1717
// Then it should return -Infinity
1818
// Delete this test.todo and replace it with a test.
19-
test.todo("given an empty array, returns -Infinity");
19+
test("given an empty array, returns -Infinity", () => {
20+
expect(findMax([])).toBe(-Infinity);
21+
});
2022

2123
// Given an array with one number
2224
// When passed to the max function

0 commit comments

Comments
 (0)