Skip to content

Commit 44859cb

Browse files
committed
test: remove unnecessary comments and documentation from mean test file
1 parent 58bc16c commit 44859cb

1 file changed

Lines changed: 0 additions & 46 deletions

File tree

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

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,5 @@
1-
/* Calculate the mean of an array of numbers
2-
3-
In this kata, you will need to implement a function that calculates the mean of an array of numbers.
4-
5-
E.g. calculateMean([1, 2, 6]), target output: 3
6-
E.g. calculateMean([]) throws Error("calculateMean requires a non-empty array")
7-
E.g. calculateMean("banana") throws Error("calculateMean requires an array of numbers")
8-
9-
There is no mean of an empty array, and a string isn't an array of numbers, so
10-
calculateMean should throw rather than return a value. This is the same problem
11-
calculateMedian solves in the prep and in the fix directory.
12-
13-
You should implement this function in mean.js, and add tests for it in this file.
14-
15-
We have set things up already so that this file can see your function from the other file.
16-
*/
17-
181
const calculateMean = require("./mean.js");
192

20-
// Acceptance criteria:
21-
22-
// Given an array of numbers
23-
// When passed to calculateMean
24-
// Then it should return their mean
25-
// Delete this test.todo and replace it with a test.
263
test("given [1, 2, 6], returns 3", () => {
274
expect(calculateMean([1, 2, 6])).toBe(3);
285
});
@@ -52,26 +29,3 @@ test("throws for an array containing. a non-number", () => {
5229
new Error("calculateMean requires a array of numbers")
5330
);
5431
});
55-
// Given an array with a single number
56-
// When passed to calculateMean
57-
// Then it should return that number
58-
59-
// Given an array containing negative or decimal numbers
60-
// When passed to calculateMean
61-
// Then it should return the correct mean
62-
63-
// Given an empty array
64-
// When passed to calculateMean
65-
// Then it should throw Error("calculateMean requires a non-empty array")
66-
67-
// Given a value that isn't an array, e.g. "banana", 42, null or {}
68-
// When passed to calculateMean
69-
// Then it should throw Error("calculateMean requires an array of numbers")
70-
71-
// Given no argument at all
72-
// When passed to calculateMean
73-
// Then it should throw Error("calculateMean requires an array of numbers")
74-
75-
// Given an array containing a non-number value, e.g. [1, "2", 3]
76-
// When passed to calculateMean
77-
// Then it should throw Error("calculateMean requires an array of numbers")

0 commit comments

Comments
 (0)