Skip to content

Commit 96c5786

Browse files
committed
Fixed some errors following the feedback instructions
1 parent 396a9c0 commit 96c5786

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Sprint-1/implement/max.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ test("ignores non-number values and returns the max", () => {
5656
});
5757

5858
// Given an array with only non-number values
59+
test("ignores numeric strings like '300'", () => {
60+
expect(findMax(["300", 100])).toBe(100);
61+
});
62+
5963
// When passed to the max function
6064
// Then it should return the least surprising value given how it behaves for all other inputs
6165
test("given only non-number values, returns null", () => {

Sprint-1/implement/sum.test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ test("given negative numbers, returns the correct total", () => {
3535
// When passed to the sum function
3636
// Then it should return the correct total sum
3737
test("given decimal numbers, returns the correct total", () => {
38-
expect(sum([1.5, 2.5, 3])).toBe(7);
38+
expect(sum([1.5, 2.5, 3])).toBeCloseTo(7);
3939
});
4040

4141
// Given an array containing non-number values
@@ -45,11 +45,9 @@ test("ignores non-number values and returns the sum", () => {
4545
expect(sum(["hey", 10, "hi", 60, 10])).toBe(80);
4646
});
4747

48-
4948
// Given an array with only non-number values
5049
// When passed to the sum function
5150
// Then it should return the least surprising value given how it behaves for all other inputs
5251
test("given only non-number values, returns 0", () => {
5352
expect(sum(["hey", "hi", null, undefined, NaN])).toBe(0);
5453
});
55-

0 commit comments

Comments
 (0)