@@ -2,24 +2,29 @@ import { describe, expect, test, xtest } from '@jest/globals';
22import { hey } from './bob' ;
33
44describe ( 'Bob' , ( ) => {
5- test ( 'stating something ' , ( ) => {
6- const result = hey ( 'Tom-ay-to, tom-aaaah-to. ' ) ;
7- expect ( result ) . toEqual ( 'Whatever .' ) ;
5+ test ( 'asking a question ' , ( ) => {
6+ const result = hey ( 'Does this cryogenic chamber make me look fat? ' ) ;
7+ expect ( result ) . toEqual ( 'Sure .' ) ;
88 } ) ;
99
1010 xtest ( 'shouting' , ( ) => {
1111 const result = hey ( 'WATCH OUT!' ) ;
1212 expect ( result ) . toEqual ( 'Whoa, chill out!' ) ;
1313 } ) ;
1414
15- xtest ( 'shouting gibberish ' , ( ) => {
16- const result = hey ( 'FCECDFCAAB ' ) ;
17- expect ( result ) . toEqual ( 'Whoa, chill out!' ) ;
15+ xtest ( 'forceful question ' , ( ) => {
16+ const result = hey ( 'WHAT THE HELL WERE YOU THINKING? ' ) ;
17+ expect ( result ) . toEqual ( "Calm down, I know what I'm doing!" ) ;
1818 } ) ;
1919
20- xtest ( 'asking a question' , ( ) => {
21- const result = hey ( 'Does this cryogenic chamber make me look fat?' ) ;
22- expect ( result ) . toEqual ( 'Sure.' ) ;
20+ xtest ( 'silence' , ( ) => {
21+ const result = hey ( '' ) ;
22+ expect ( result ) . toEqual ( 'Fine. Be that way!' ) ;
23+ } ) ;
24+
25+ xtest ( 'stating something' , ( ) => {
26+ const result = hey ( 'Tom-ay-to, tom-aaaah-to.' ) ;
27+ expect ( result ) . toEqual ( 'Whatever.' ) ;
2328 } ) ;
2429
2530 xtest ( 'asking a numeric question' , ( ) => {
@@ -32,64 +37,54 @@ describe('Bob', () => {
3237 expect ( result ) . toEqual ( 'Sure.' ) ;
3338 } ) ;
3439
35- xtest ( 'talking forcefully' , ( ) => {
36- const result = hey ( "Let's go make out behind the gym!" ) ;
37- expect ( result ) . toEqual ( 'Whatever.' ) ;
38- } ) ;
39-
40- xtest ( 'using acronyms in regular speech' , ( ) => {
41- const result = hey ( "It's OK if you don't want to go to the DMV." ) ;
42- expect ( result ) . toEqual ( 'Whatever.' ) ;
40+ xtest ( 'question with no letters' , ( ) => {
41+ const result = hey ( '4?' ) ;
42+ expect ( result ) . toEqual ( 'Sure.' ) ;
4343 } ) ;
4444
45- xtest ( 'forceful question' , ( ) => {
46- const result = hey ( 'WHAT THE HELL WERE YOU THINKING ?' ) ;
47- expect ( result ) . toEqual ( "Calm down, I know what I'm doing!" ) ;
45+ xtest ( 'non-letters with question' , ( ) => {
46+ const result = hey ( ':) ?' ) ;
47+ expect ( result ) . toEqual ( 'Sure.' ) ;
4848 } ) ;
4949
50- xtest ( 'shouting numbers ' , ( ) => {
51- const result = hey ( '1, 2, 3 GO! ' ) ;
52- expect ( result ) . toEqual ( 'Whoa, chill out! ' ) ;
50+ xtest ( 'prattling on ' , ( ) => {
51+ const result = hey ( 'Wait! Hang on. Are you going to be OK? ' ) ;
52+ expect ( result ) . toEqual ( 'Sure. ' ) ;
5353 } ) ;
5454
55- xtest ( 'no letters ' , ( ) => {
56- const result = hey ( '1, 2, 3 ' ) ;
57- expect ( result ) . toEqual ( 'Whatever .' ) ;
55+ xtest ( 'ending with whitespace ' , ( ) => {
56+ const result = hey ( 'Okay if like my spacebar quite a bit? ' ) ;
57+ expect ( result ) . toEqual ( 'Sure .' ) ;
5858 } ) ;
5959
60- xtest ( 'question with no letters ' , ( ) => {
61- const result = hey ( '4 ?' ) ;
60+ xtest ( 'multiple line question ' , ( ) => {
61+ const result = hey ( '\nDoes this cryogenic chamber make\n me look fat ?' ) ;
6262 expect ( result ) . toEqual ( 'Sure.' ) ;
6363 } ) ;
6464
65- xtest ( 'shouting with special characters ' , ( ) => {
66- const result = hey ( 'ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1! ' ) ;
65+ xtest ( 'shouting gibberish ' , ( ) => {
66+ const result = hey ( 'FCECDFCAAB ' ) ;
6767 expect ( result ) . toEqual ( 'Whoa, chill out!' ) ;
6868 } ) ;
6969
70- xtest ( 'shouting with no exclamation mark' , ( ) => {
71- const result = hey ( 'I HATE YOU ' ) ;
70+ xtest ( 'shouting a statement containing a question mark' , ( ) => {
71+ const result = hey ( 'DO LIONS EAT PEOPLE? AHHHHH. ' ) ;
7272 expect ( result ) . toEqual ( 'Whoa, chill out!' ) ;
7373 } ) ;
7474
75- xtest ( 'statement containing question mark' , ( ) => {
76- const result = hey ( 'Ending with a ? means a question.' ) ;
77- expect ( result ) . toEqual ( 'Whatever.' ) ;
78- } ) ;
79-
80- xtest ( 'non-letters with question' , ( ) => {
81- const result = hey ( ':) ?' ) ;
82- expect ( result ) . toEqual ( 'Sure.' ) ;
75+ xtest ( 'shouting numbers' , ( ) => {
76+ const result = hey ( '1, 2, 3 GO!' ) ;
77+ expect ( result ) . toEqual ( 'Whoa, chill out!' ) ;
8378 } ) ;
8479
85- xtest ( 'prattling on ' , ( ) => {
86- const result = hey ( 'Wait! Hang on. Are you going to be OK? ' ) ;
87- expect ( result ) . toEqual ( 'Sure. ' ) ;
80+ xtest ( 'shouting with special characters ' , ( ) => {
81+ const result = hey ( 'ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1! ' ) ;
82+ expect ( result ) . toEqual ( 'Whoa, chill out! ' ) ;
8883 } ) ;
8984
90- xtest ( 'silence ' , ( ) => {
91- const result = hey ( '' ) ;
92- expect ( result ) . toEqual ( 'Fine. Be that way !' ) ;
85+ xtest ( 'shouting with no exclamation mark ' , ( ) => {
86+ const result = hey ( 'I HATE YOU ' ) ;
87+ expect ( result ) . toEqual ( 'Whoa, chill out !' ) ;
9388 } ) ;
9489
9590 xtest ( 'prolonged silence' , ( ) => {
@@ -102,24 +97,34 @@ describe('Bob', () => {
10297 expect ( result ) . toEqual ( 'Fine. Be that way!' ) ;
10398 } ) ;
10499
105- xtest ( 'multiple line question ' , ( ) => {
106- const result = hey ( '\nDoes this cryogenic chamber make\n me look fat? ' ) ;
107- expect ( result ) . toEqual ( 'Sure. ' ) ;
100+ xtest ( 'other whitespace ' , ( ) => {
101+ const result = hey ( '\n\r \t ' ) ;
102+ expect ( result ) . toEqual ( 'Fine. Be that way! ' ) ;
108103 } ) ;
109104
110- xtest ( 'starting with whitespace ' , ( ) => {
111- const result = hey ( ' hmmmmmmm...' ) ;
105+ xtest ( 'talking forcefully ' , ( ) => {
106+ const result = hey ( "Let's go make out behind the gym!" ) ;
112107 expect ( result ) . toEqual ( 'Whatever.' ) ;
113108 } ) ;
114109
115- xtest ( 'ending with whitespace ' , ( ) => {
116- const result = hey ( 'Okay if like my spacebar quite a bit? ' ) ;
117- expect ( result ) . toEqual ( 'Sure .' ) ;
110+ xtest ( 'using acronyms in regular speech ' , ( ) => {
111+ const result = hey ( "It's OK if you don't want to go to the DMV." ) ;
112+ expect ( result ) . toEqual ( 'Whatever .' ) ;
118113 } ) ;
119114
120- xtest ( 'other whitespace' , ( ) => {
121- const result = hey ( '\n\r \t' ) ;
122- expect ( result ) . toEqual ( 'Fine. Be that way!' ) ;
115+ xtest ( 'no letters' , ( ) => {
116+ const result = hey ( '1, 2, 3' ) ;
117+ expect ( result ) . toEqual ( 'Whatever.' ) ;
118+ } ) ;
119+
120+ xtest ( 'statement containing question mark' , ( ) => {
121+ const result = hey ( 'Ending with a ? means a question.' ) ;
122+ expect ( result ) . toEqual ( 'Whatever.' ) ;
123+ } ) ;
124+
125+ xtest ( 'starting with whitespace' , ( ) => {
126+ const result = hey ( ' hmmmmmmm...' ) ;
127+ expect ( result ) . toEqual ( 'Whatever.' ) ;
123128 } ) ;
124129
125130 xtest ( 'non-question ending with whitespace' , ( ) => {
0 commit comments