@@ -38,15 +38,21 @@ test('Load "conventional-changelog-angular" by default', async t => {
3838} ) ;
3939
4040test ( '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+ } ;
4245 const parserOpts = await loadParserConfig ( { parserOpts : customParserOpts } , { cwd} ) ;
4346
4447 t . is ( customParserOpts . headerPattern , parserOpts . headerPattern ) ;
4548 t . deepEqual ( customParserOpts . headerCorrespondence , parserOpts . headerCorrespondence ) ;
4649} ) ;
4750
4851test ( '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+ } ;
5056 const parserOpts = await loadParserConfig ( { parserOpts : customParserOpts , preset : 'angular' } , { cwd} ) ;
5157
5258 t . is ( customParserOpts . headerPattern , parserOpts . headerPattern ) ;
@@ -55,7 +61,10 @@ test('Accept a partial "parserOpts" object as option that overlaod a preset', as
5561} ) ;
5662
5763test ( '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+ } ;
5968 const parserOpts = await loadParserConfig (
6069 { parserOpts : customParserOpts , config : 'conventional-changelog-angular' } ,
6170 { cwd}
0 commit comments