-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmexican-wave.test.js
42 lines (41 loc) · 939 Bytes
/
mexican-wave.test.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
import wave from './mexican-wave';
describe('mexican-wave', () => {
test('case #1', () => {
const result = ['Hello', 'hEllo', 'heLlo', 'helLo', 'hellO'];
expect(wave('hello')).toEqual(result);
});
test('case #1', () => {
const result = [
'Codewars',
'cOdewars',
'coDewars',
'codEwars',
'codeWars',
'codewArs',
'codewaRs',
'codewarS',
];
expect(wave('codewars')).toEqual(result);
});
test('case #2', () => {
const result = [];
expect(wave('')).toEqual(result);
});
test('case #3', () => {
const result = [
'Two words',
'tWo words',
'twO words',
'two Words',
'two wOrds',
'two woRds',
'two worDs',
'two wordS',
];
expect(wave('two words')).toEqual(result);
});
test('case #4', () => {
const result = [' Gap ', ' gAp ', ' gaP '];
expect(wave(' gap ')).toEqual(result);
});
});