1- import { checkPangram } from '../CheckPangram'
1+ import { checkPangramRegex , checkPangramSet } from '../CheckPangram'
22
3- describe ( 'checkPangram ' , ( ) => {
3+ describe ( 'Testing checkPangramRegex function ' , ( ) => {
44 it ( '"The quick brown fox jumps over the lazy dog" is a pangram' , ( ) => {
55 expect (
6- checkPangram ( 'The quick brown fox jumps over the lazy dog' )
7- ) . toBeTruthy ( )
6+ checkPangramRegex ( 'The quick brown fox jumps over the lazy dog' )
7+ ) . toBe ( true )
88 } )
99
1010 it ( '"Waltz, bad nymph, for quick jigs vex." is a pangram' , ( ) => {
11- expect ( checkPangram ( 'Waltz, bad nymph, for quick jigs vex.' ) ) . toBeTruthy ( )
11+ expect ( checkPangramRegex ( 'Waltz, bad nymph, for quick jigs vex.' ) ) . toBe ( true )
1212 } )
1313
1414 it ( '"Jived fox nymph grabs quick waltz." is a pangram' , ( ) => {
15- expect ( checkPangram ( 'Jived fox nymph grabs quick waltz.' ) ) . toBeTruthy ( )
15+ expect ( checkPangramRegex ( 'Jived fox nymph grabs quick waltz.' ) ) . toBe ( true )
1616 } )
1717
1818 it ( '"My name is Unknown" is NOT a pangram' , ( ) => {
19- expect ( checkPangram ( 'My name is Unknown' ) ) . toBeFalsy ( )
19+ expect ( checkPangramRegex ( 'My name is Unknown' ) ) . toBe ( false )
2020 } )
2121
2222 it ( '"The quick brown fox jumps over the la_y dog" is NOT a pangram' , ( ) => {
2323 expect (
24- checkPangram ( 'The quick brown fox jumps over the la_y dog' )
25- ) . toBeFalsy ( )
24+ checkPangramRegex ( 'The quick brown fox jumps over the la_y dog' )
25+ ) . toBe ( false )
2626 } )
2727
2828 it ( 'Throws an error if given param is not a string' , ( ) => {
2929 expect ( ( ) => {
30- checkPangram ( undefined )
30+ checkPangramRegex ( undefined )
3131 } ) . toThrow ( 'The given value is not a string' )
3232 } )
3333} )
34+
35+ describe ( 'Testing checkPangramSet function' , ( ) => {
36+ it ( '"The quick brown fox jumps over the lazy dog" is a pangram' , ( ) => {
37+ expect (
38+ checkPangramSet ( 'The quick brown fox jumps over the lazy dog' )
39+ ) . toBe ( true )
40+ } )
41+
42+ it ( '"Waltz, bad nymph, for quick jigs vex." is a pangram' , ( ) => {
43+ expect ( checkPangramSet ( 'Waltz, bad nymph, for quick jigs vex.' ) ) . toBe ( true )
44+ } )
45+
46+ it ( '"Jived fox nymph grabs quick waltz." is a pangram' , ( ) => {
47+ expect ( checkPangramSet ( 'Jived fox nymph grabs quick waltz.' ) ) . toBe ( true )
48+ } )
49+
50+ it ( '"My name is Unknown" is NOT a pangram' , ( ) => {
51+ expect ( checkPangramSet ( 'My name is Unknown' ) ) . toBe ( false )
52+ } )
53+
54+ it ( '"The quick brown fox jumps over the la_y dog" is NOT a pangram' , ( ) => {
55+ expect (
56+ checkPangramSet ( 'The quick brown fox jumps over the la_y dog' )
57+ ) . toBe ( false )
58+ } )
59+
60+ it ( 'Throws an error if given param is not a string' , ( ) => {
61+ expect ( ( ) => {
62+ checkPangramSet ( undefined )
63+ } ) . toThrow ( 'The given value is not a string' )
64+ } )
65+ } )
0 commit comments