Skip to content
This repository was archived by the owner on Jan 14, 2024. It is now read-only.

Commit 5486c55

Browse files
author
Dedekind561
committed
wrap tests in describe and format
1 parent 3537baf commit 5486c55

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

extra/1-factorial.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,21 @@
99
*/
1010

1111
function factorial(input) {
12-
// TODO
12+
// TODO
1313
}
1414

1515
/* ======= TESTS - DO NOT MODIFY ===== */
1616

17-
test("3! should be 6", () => {
17+
describe("factorial", () => {
18+
test("3! should be 6", () => {
1819
expect(factorial(3)).toEqual(6);
19-
});
20+
});
2021

21-
test("5! should be 120", () => {
22+
test("5! should be 120", () => {
2223
expect(factorial(5)).toEqual(120);
23-
});
24+
});
2425

25-
test("10! should be 3628800", () => {
26+
test("10! should be 3628800", () => {
2627
expect(factorial(10)).toEqual(3628800);
28+
});
2729
});

mandatory/1-fix-functions.js

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function getMood() {
2020
}
2121
}
2222

23-
function greaterThan10(num) {
23+
function greaterThan10(num) {
2424
let isBigEnough;
2525

2626
if (isBigEnough) {
@@ -32,35 +32,30 @@ function greaterThan10(num) {
3232

3333
/* ======= TESTS - DO NOT MODIFY ===== */
3434

35-
36-
describe('getMood',() => {
35+
describe("getMood", () => {
3736
test("getMood function works for true", () => {
3837
expect(getMood(true)).toEqual("I am happy");
3938
});
40-
39+
4140
test("getMood function works for false", () => {
4241
expect(getMood(false)).toEqual("I am not happy");
4342
});
44-
})
43+
});
4544

46-
describe('greaterThanTen',() => {
45+
describe("greaterThanTen", () => {
4746
test("works for value greater than 10", () => {
4847
expect(greaterThan10(11)).toEqual("num is greater than 10");
4948
});
50-
49+
5150
test("works for value much greater than 10", () => {
5251
expect(greaterThan10(96)).toEqual("num is greater than 10");
5352
});
54-
53+
5554
test("works for value less than 10", () => {
5655
expect(greaterThan10(9)).toEqual("num is not big enough");
5756
});
58-
57+
5958
test("works for value equal to 10", () => {
6059
expect(greaterThan10(10)).toEqual("num is not big enough");
6160
});
62-
})
63-
64-
65-
66-
61+
});

0 commit comments

Comments
 (0)