-
Notifications
You must be signed in to change notification settings - Fork 269
/
count-vowels.test.js
49 lines (39 loc) · 1.38 KB
/
count-vowels.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
43
44
45
46
47
48
49
const { countVowelsItteratively, countVowelsItterativelyES6, countVowelsUsingRegex } = require('.');
describe('Count Vowels', () => {
const apple = 'AppLe';
const education = 'education';
const myths = 'myths';
describe('Count by regular itteration', () => {
it('Should return 2 for `Apple`', () => {
expect(countVowelsItteratively(apple)).toEqual(2);
});
it('Should return 5 for `Education`', () => {
expect(countVowelsItteratively(education)).toEqual(5);
});
it('Should return 0 for `Myths`', () => {
expect(countVowelsItteratively(myths)).toEqual(0);
});
});
describe('Count by ES6 itteration', () => {
it('Should return 2 for `Apple`', () => {
expect(countVowelsItterativelyES6(apple)).toEqual(2);
});
it('Should return 5 for `Education`', () => {
expect(countVowelsItterativelyES6(education)).toEqual(5);
});
it('Should return 0 for `Myths`', () => {
expect(countVowelsItterativelyES6(myths)).toEqual(0);
});
});
describe('Count using REGEX', () => {
it('Should return 2 for `Apple`', () => {
expect(countVowelsUsingRegex(apple)).toEqual(2);
});
it('Should return 5 for `Education`', () => {
expect(countVowelsUsingRegex(education)).toEqual(5);
});
it('Should return 0 for `Myths`', () => {
expect(countVowelsUsingRegex(myths)).toEqual(0);
});
});
});