-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpangram.spec.js
More file actions
51 lines (41 loc) · 1.31 KB
/
Copy pathpangram.spec.js
File metadata and controls
51 lines (41 loc) · 1.31 KB
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
import { isPangram } from './pangram';
describe('Pangram()', () => {
test('empty sentence', () => {
expect(isPangram('')).toBe(false);
});
test('perfect lower case', () => {
expect(isPangram('abcdefghijklmnopqrstuvwxyz')).toBe(true);
});
test('only lower case', () => {
expect(isPangram('the quick brown fox jumps over the lazy dog')).toBe(true);
});
test("missing the letter 'x'", () => {
expect(
isPangram('a quick movement of the enemy will jeopardize five gunboats')
).toBe(false);
});
test("missing the letter 'h'", () => {
expect(isPangram('five boxing wizards jump quickly at it')).toBe(false);
});
test('with underscores', () => {
expect(isPangram('the_quick_brown_fox_jumps_over_the_lazy_dog')).toBe(true);
});
test('with numbers', () => {
expect(isPangram('the 1 quick brown fox jumps over the 2 lazy dogs')).toBe(
true
);
});
test('missing letters replaced by numbers', () => {
expect(isPangram('7h3 qu1ck brown fox jumps ov3r 7h3 lazy dog')).toBe(
false
);
});
test('mixed case and punctuation', () => {
expect(isPangram('"Five quacking Zephyrs jolt my wax bed."')).toBe(true);
});
test('case insensitive', () => {
expect(isPangram('the quick brown fox jumps over with lazy FX')).toBe(
false
);
});
});