You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 98d4d64
Browse filesBrowse the repository at this point in the historyBrowse files
// Then it should return "The median is " followed by the median
23
23
// Delete this test.todo and replace it with a test.
24
-
test.todo('given [1, 2, 3], returns "The median is 2"');
24
+
test('given [1, 2, 3], returns "The median is 2"',()=>{
25
+
expect(describeMedian([1,2,3])).toEqual("The median is 2");
26
+
});
25
27
26
28
// Given an empty array
27
29
// When passed to describeMedian
28
30
// Then it should return "Could not calculate a median: calculateMedian requires a non-empty array"
31
+
test('given an empty array,should return "Could not calculate a median: calculateMedian requires a non-empty array"',()=>{
32
+
expect(describeMedian([])).toEqual(
33
+
"Could not calculate a median: calculateMedian requires a non-empty array"
34
+
);
35
+
});
29
36
30
37
// Given something that isn't an array of numbers, e.g. "banana"
31
38
// When passed to describeMedian
32
39
// Then it should return "Could not calculate a median: calculateMedian requires an array of numbers"
40
+
test('given something that is not an array of numbers, should return "Could not calculate a median: calculateMedian requires an array of numbers"',()=>{
41
+
expect(describeMedian(32)).toEqual(
42
+
"Could not calculate a median: calculateMedian requires an array of numbers"
43
+
);
44
+
expect(describeMedian("banana")).toEqual(
45
+
"Could not calculate a median: calculateMedian requires an array of numbers"
0 commit comments