forked from TheAlgorithms/JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCheckPangram.test.js
33 lines (27 loc) · 1.01 KB
/
CheckPangram.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
import { checkPangram } from '../CheckPangram'
describe('checkPangram', () => {
it('"The quick brown fox jumps over the lazy dog" is a pangram', () => {
expect(
checkPangram('The quick brown fox jumps over the lazy dog')
).toBeTruthy()
})
it('"Waltz, bad nymph, for quick jigs vex." is a pangram', () => {
expect(checkPangram('Waltz, bad nymph, for quick jigs vex.')).toBeTruthy()
})
it('"Jived fox nymph grabs quick waltz." is a pangram', () => {
expect(checkPangram('Jived fox nymph grabs quick waltz.')).toBeTruthy()
})
it('"My name is Unknown" is NOT a pangram', () => {
expect(checkPangram('My name is Unknown')).toBeFalsy()
})
it('"The quick brown fox jumps over the la_y dog" is NOT a pangram', () => {
expect(
checkPangram('The quick brown fox jumps over the la_y dog')
).toBeFalsy()
})
it('Throws an error if given param is not a string', () => {
expect(() => {
checkPangram(undefined)
}).toThrow('The given value is not a string')
})
})