@@ -38,15 +38,21 @@ test('Load "conventional-changelog-angular" by default', async t => {
38
38
} ) ;
39
39
40
40
test ( 'Accept a "parserOpts" object as option' , async t => {
41
- const customParserOpts = { headerPattern : / ^ # # ( .* ?) # # ( .* ) $ / , headerCorrespondence : [ 'tag' , 'shortDesc' ] } ;
41
+ const customParserOpts = {
42
+ headerPattern : / ^ # # (?< type > .* ?) # # (?< subject > .* ) $ / ,
43
+ headerCorrespondence : [ 'tag' , 'shortDesc' ] ,
44
+ } ;
42
45
const parserOpts = await loadParserConfig ( { parserOpts : customParserOpts } , { cwd} ) ;
43
46
44
47
t . is ( customParserOpts . headerPattern , parserOpts . headerPattern ) ;
45
48
t . deepEqual ( customParserOpts . headerCorrespondence , parserOpts . headerCorrespondence ) ;
46
49
} ) ;
47
50
48
51
test ( 'Accept a partial "parserOpts" object as option that overlaod a preset' , async t => {
49
- const customParserOpts = { headerPattern : / ^ # # ( .* ?) # # ( .* ) $ / , headerCorrespondence : [ 'tag' , 'shortDesc' ] } ;
52
+ const customParserOpts = {
53
+ headerPattern : / ^ # # (?< type > .* ?) # # (?< subject > .* ) $ / ,
54
+ headerCorrespondence : [ 'tag' , 'shortDesc' ] ,
55
+ } ;
50
56
const parserOpts = await loadParserConfig ( { parserOpts : customParserOpts , preset : 'angular' } , { cwd} ) ;
51
57
52
58
t . is ( customParserOpts . headerPattern , parserOpts . headerPattern ) ;
@@ -55,7 +61,10 @@ test('Accept a partial "parserOpts" object as option that overlaod a preset', as
55
61
} ) ;
56
62
57
63
test ( 'Accept a partial "parserOpts" object as option that overlaod a config' , async t => {
58
- const customParserOpts = { headerPattern : / ^ # # ( .* ?) # # ( .* ) $ / , headerCorrespondence : [ 'tag' , 'shortDesc' ] } ;
64
+ const customParserOpts = {
65
+ headerPattern : / ^ # # (?< type > .* ?) # # (?< subject > .* ) $ / ,
66
+ headerCorrespondence : [ 'tag' , 'shortDesc' ] ,
67
+ } ;
59
68
const parserOpts = await loadParserConfig (
60
69
{ parserOpts : customParserOpts , config : 'conventional-changelog-angular' } ,
61
70
{ cwd}
0 commit comments