-
-
Notifications
You must be signed in to change notification settings - Fork 633
/
Copy pathbob.spec.js
128 lines (103 loc) · 3.53 KB
/
bob.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { hey } from './bob';
describe('Bob', () => {
test('stating something', () => {
const result = hey('Tom-ay-to, tom-aaaah-to.');
expect(result).toEqual('Whatever.');
});
xtest('shouting', () => {
const result = hey('WATCH OUT!');
expect(result).toEqual('Whoa, chill out!');
});
xtest('shouting gibberish', () => {
const result = hey('FCECDFCAAB');
expect(result).toEqual('Whoa, chill out!');
});
xtest('asking a question', () => {
const result = hey('Does this cryogenic chamber make me look fat?');
expect(result).toEqual('Sure.');
});
xtest('asking a numeric question', () => {
const result = hey('You are, what, like 15?');
expect(result).toEqual('Sure.');
});
xtest('asking gibberish', () => {
const result = hey('fffbbcbeab?');
expect(result).toEqual('Sure.');
});
xtest('talking forcefully', () => {
const result = hey("Let's go make out behind the gym!");
expect(result).toEqual('Whatever.');
});
xtest('using acronyms in regular speech', () => {
const result = hey("It's OK if you don't want to go to the DMV.");
expect(result).toEqual('Whatever.');
});
xtest('forceful question', () => {
const result = hey('WHAT THE HELL WERE YOU THINKING?');
expect(result).toEqual("Calm down, I know what I'm doing!");
});
xtest('shouting numbers', () => {
const result = hey('1, 2, 3 GO!');
expect(result).toEqual('Whoa, chill out!');
});
xtest('no letters', () => {
const result = hey('1, 2, 3');
expect(result).toEqual('Whatever.');
});
xtest('question with no letters', () => {
const result = hey('4?');
expect(result).toEqual('Sure.');
});
xtest('shouting with special characters', () => {
const result = hey('ZOMG THE %^*@#$(*^ ZOMBIES ARE COMING!!11!!1!');
expect(result).toEqual('Whoa, chill out!');
});
xtest('shouting with no exclamation mark', () => {
const result = hey('I HATE YOU');
expect(result).toEqual('Whoa, chill out!');
});
xtest('statement containing question mark', () => {
const result = hey('Ending with a ? means a question.');
expect(result).toEqual('Whatever.');
});
xtest('non-letters with question', () => {
const result = hey(':) ?');
expect(result).toEqual('Sure.');
});
xtest('prattling on', () => {
const result = hey('Wait! Hang on. Are you going to be OK?');
expect(result).toEqual('Sure.');
});
xtest('silence', () => {
const result = hey('');
expect(result).toEqual('Fine. Be that way!');
});
xtest('prolonged silence', () => {
const result = hey(' ');
expect(result).toEqual('Fine. Be that way!');
});
xtest('alternate silence', () => {
const result = hey('\t\t\t\t\t\t\t\t\t\t');
expect(result).toEqual('Fine. Be that way!');
});
xtest('multiple line question', () => {
const result = hey('\nDoes this cryogenic chamber make me look fat?\nno');
expect(result).toEqual('Whatever.');
});
xtest('starting with whitespace', () => {
const result = hey(' hmmmmmmm...');
expect(result).toEqual('Whatever.');
});
xtest('ending with whitespace', () => {
const result = hey('Okay if like my spacebar quite a bit? ');
expect(result).toEqual('Sure.');
});
xtest('other whitespace', () => {
const result = hey('\n\r \t');
expect(result).toEqual('Fine. Be that way!');
});
xtest('non-question ending with whitespace', () => {
const result = hey('This is a statement ending with whitespace ');
expect(result).toEqual('Whatever.');
});
});