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