We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb96503 commit 7dcc6d3Copy full SHA for 7dcc6d3
1 file changed
Sprint-1/implement/sum.test.js
@@ -37,6 +37,8 @@ test("given an array with negative numbers, returns the correct sum", () => {
37
// Then it should return the correct total sum
38
test("given an array with decimal numbers, returns the correct sum", () => {
39
expect(sum([1.5, 2.5, 3.0])).toEqual(7);
40
+ // toBeCloseTo is used for floating point calculations to avoid precision issues
41
+ expect(sum([1.2, 0.6, 0.005])).toBeCloseTo(1.805);
42
});
43
44
// Given an array containing non-number values
0 commit comments