Skip to content

Commit 233bf8f

Browse files
committed
modified the test of mean.js
1 parent e789ef9 commit 233bf8f

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎Sprint-1/implement/mean.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ function calculateMean(list) {
2121
return mean;
2222
}
2323

24+
2425
module.exports = calculateMean;

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,19 @@ describe("calculateMean", () => {
110110
new Error("calculateMean requires an array of numbers")
111111
);
112112
});
113+
114+
it("returns for [Infinity, 0, -Infinity]", () => {
115+
() =>
116+
expect(calculateMean([Infinity, 0, -Infinity])).toThrow(
117+
new Error("calculateMean requires an array of numbers")
118+
);
119+
});
120+
121+
it("returns for [0, NaN]", () => {
122+
() =>
123+
expect(calculateMean([0, NaN])).toThrow(
124+
new Error("calculateMean requires an array of numbers")
125+
);
126+
});
127+
113128
});

0 commit comments

Comments
 (0)