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

Commit 3537baf

Browse files
author
Dedekind561
committed
update function names and wrap in describe blocks
1 parent 0d1f5d5 commit 3537baf

File tree

1 file changed

+30
-21
lines changed

1 file changed

+30
-21
lines changed

mandatory/1-fix-functions.js

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
*/
1212

13-
function mood() {
13+
function getMood() {
1414
let isHappy = true;
1515

1616
if (isHappy) {
@@ -20,7 +20,7 @@ function mood() {
2020
}
2121
}
2222

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

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

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

35-
test("mood function works for true", () => {
36-
expect(mood(true)).toEqual("I am happy");
37-
});
3835

39-
test("mood function works for false", () => {
40-
expect(mood(false)).toEqual("I am not happy");
41-
});
36+
describe('getMood',() => {
37+
test("getMood function works for true", () => {
38+
expect(getMood(true)).toEqual("I am happy");
39+
});
40+
41+
test("getMood function works for false", () => {
42+
expect(getMood(false)).toEqual("I am not happy");
43+
});
44+
})
45+
46+
describe('greaterThanTen',() => {
47+
test("works for value greater than 10", () => {
48+
expect(greaterThan10(11)).toEqual("num is greater than 10");
49+
});
50+
51+
test("works for value much greater than 10", () => {
52+
expect(greaterThan10(96)).toEqual("num is greater than 10");
53+
});
54+
55+
test("works for value less than 10", () => {
56+
expect(greaterThan10(9)).toEqual("num is not big enough");
57+
});
58+
59+
test("works for value equal to 10", () => {
60+
expect(greaterThan10(10)).toEqual("num is not big enough");
61+
});
62+
})
63+
4264

43-
test("greaterThanTen function works for value greater than 10", () => {
44-
expect(greaterThan10(11)).toEqual("num is greater than 10");
45-
});
4665

47-
test("greaterThanTen function works for value much greater than 10", () => {
48-
expect(greaterThan10(96)).toEqual("num is greater than 10");
49-
});
5066

51-
test("greaterThanTen function works for value less than 10", () => {
52-
expect(greaterThan10(9)).toEqual("num is not big enough");
53-
});
54-
55-
test("greaterThanTen function works for value equal to 10", () => {
56-
expect(greaterThan10(10)).toEqual("num is not big enough");
57-
});

0 commit comments

Comments
 (0)