Skip to content

Commit fb96503

Browse files
committed
Fix: Add numeric string test case to findMax tests
1 parent f786fca commit fb96503

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Sprint-1/implement/max.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ test("given an array with decimal numbers, return the largest decimal number", (
5454
// Then it should return the max and ignore non-numeric values
5555
test("given an array with non-numeric values, returns the max and ignores non-numerics", () => {
5656
expect(findMax(["hey", 10, "hi", 60, 10])).toEqual(60);
57+
// "300" looks numeric but is a string, so it should be ignored
58+
expect(findMax([10, "300", 20])).toEqual(20);
5759
});
5860

5961
// Given an array with only non-number values

0 commit comments

Comments
 (0)