@@ -21,8 +21,34 @@ describe('commit start with gitmoji code', () => {
2121 ] ) ;
2222 } ) ;
2323
24- it ( 'should pass when return right commit message code' , ( ) => {
24+ it ( 'should failed if commit start with unrecognized gitmoji unicode' , ( ) => {
25+ const value = emojiRule ( { raw : '🤔 chore(scope): test' } as Commit , when ) ;
26+ expect ( value ) . toEqual ( [
27+ false ,
28+ 'Your commit should start with gitmoji code,please check the emoji code on https://gitmoji.dev/.' ,
29+ ] ) ;
30+ } ) ;
31+
32+ it ( 'should failed if commit start with wrong gitmoji unicode' , ( ) => {
33+ const value = emojiRule ( { raw : '🌙 chore(scope): test' } as Commit , when ) ;
34+ expect ( value ) . toEqual ( [
35+ false ,
36+ '🌙 is not in the correct gitmoji list, please check the emoji code on https://gitmoji.dev/.' ,
37+ ] ) ;
38+ } ) ;
39+
40+ it ( 'should pass when return correct commit message code' , ( ) => {
2541 const value = emojiRule ( { raw : ':tada: test' } as Commit , when ) ;
2642 expect ( value ) . toEqual ( [ true , 'passed' ] ) ;
2743 } ) ;
44+
45+ it ( 'should pass when with correct gitmoji unicode' , ( ) => {
46+ const value = emojiRule ( { raw : '🎉 test' } as Commit , when ) ;
47+ expect ( value ) . toEqual ( [ true , 'passed' ] ) ;
48+ } ) ;
49+
50+ it ( 'should pass when with correct test gitmoji unicode' , ( ) => {
51+ const value = emojiRule ( { raw : '✅ test' } as Commit , when ) ;
52+ expect ( value ) . toEqual ( [ true , 'passed' ] ) ;
53+ } ) ;
2854} ) ;
0 commit comments