Skip to content

Commit 7f9881d

Browse files
committed
test: add case to verify calculateMean handles negative and decimal numbers
1 parent d3d9156 commit 7f9881d

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ test("returns the number for a single item array", () => {
3131
expect(calculateMean([8])).toBe(8);
3232
});
3333

34+
test("handles negative and decimal numbers", () => {
35+
expects(calculateMean([-2, 4, 3.5])).toBeCloseTo(1.8333);
36+
});
37+
38+
test
3439
// Given an array with a single number
3540
// When passed to calculateMean
3641
// Then it should return that number

0 commit comments

Comments
 (0)