@@ -5,12 +5,16 @@ const messages = {
5
5
empty : 'test:\n' ,
6
6
with : `test: subject.\n` ,
7
7
without : `test: subject\n` ,
8
+ standardScopeWith : `type(scope): subject.\n` ,
9
+ nonStandardScopeWith : "type.scope: subject.\n"
8
10
} ;
9
11
10
12
const parsed = {
11
13
empty : parse ( messages . empty ) ,
12
14
with : parse ( messages . with ) ,
13
15
without : parse ( messages . without ) ,
16
+ standardScopeWith : parse ( messages . standardScopeWith ) ,
17
+ nonStandardScopeWith : parse ( messages . nonStandardScopeWith ) ,
14
18
} ;
15
19
16
20
test ( 'empty against "always" should succeed' , async ( ) => {
@@ -48,3 +52,15 @@ test('without against "never ." should succeed', async () => {
48
52
const expected = true ;
49
53
expect ( actual ) . toEqual ( expected ) ;
50
54
} ) ;
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