@@ -5,12 +5,16 @@ const messages = {
55 empty : 'test:\n' ,
66 with : `test: subject.\n` ,
77 without : `test: subject\n` ,
8+ standardScopeWith : `type(scope): subject.\n` ,
9+ nonStandardScopeWith : "type.scope: subject.\n"
810} ;
911
1012const parsed = {
1113 empty : parse ( messages . empty ) ,
1214 with : parse ( messages . with ) ,
1315 without : parse ( messages . without ) ,
16+ standardScopeWith : parse ( messages . standardScopeWith ) ,
17+ nonStandardScopeWith : parse ( messages . nonStandardScopeWith ) ,
1418} ;
1519
1620test ( 'empty against "always" should succeed' , async ( ) => {
@@ -48,3 +52,15 @@ test('without against "never ." should succeed', async () => {
4852 const expected = true ;
4953 expect ( actual ) . toEqual ( expected ) ;
5054} ) ;
55+
56+ test ( 'commit message title with standard scope and full-stop against "never ." should fail' , async ( ) => {
57+ const [ actual ] = subjectFullStop ( await parsed . standardScopeWith , 'never' , '.' ) ;
58+ const expected = false ;
59+ expect ( actual ) . toEqual ( expected ) ;
60+ } ) ;
61+
62+ test ( 'commit message title with non standard scope and full-stop against "never ." should fail' , async ( ) => {
63+ const [ actual ] = subjectFullStop ( await parsed . nonStandardScopeWith , 'never' , '.' ) ;
64+ const expected = false ;
65+ expect ( actual ) . toEqual ( expected ) ;
66+ } ) ;
0 commit comments