@@ -169,24 +169,38 @@ test('registers inline #', async () => {
169
169
} ) ;
170
170
171
171
test ( 'keep -side notes- in the body section' , async ( ) => {
172
- const header = " type(some/scope): subject"
173
- const body =
174
- " CI on master branch caught this:\n\n" +
175
- " ```\n" +
176
- " Unhandled Exception:\n" +
172
+ const header = ' type(some/scope): subject' ;
173
+ const body =
174
+ ' CI on master branch caught this:\n\n' +
175
+ ' ```\n' +
176
+ ' Unhandled Exception:\n' +
177
177
"System.AggregateException: One or more errors occurred. (Some problem when connecting to 'api.mycryptoapi.com/eth')\n\n" +
178
- " --- End of stack trace from previous location where exception was thrown ---\n\n" +
179
- " at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/runner/work/geewallet/geewallet/src/GWallet.Backend/FSharpUtil.fs:206\n" +
180
- " ...\n" +
181
- " ```" ;
178
+ ' --- End of stack trace from previous location where exception was thrown ---\n\n' +
179
+ ' at GWallet.Backend.FSharpUtil.ReRaise (System.Exception ex) [0x00000] in /Users/runner/work/geewallet/geewallet/src/GWallet.Backend/FSharpUtil.fs:206\n' +
180
+ ' ...\n' +
181
+ ' ```' ;
182
182
183
- const message = header + " \n\n" + body
183
+ const message = header + ' \n\n' + body ;
184
184
185
185
const actual = await parse ( message ) ;
186
186
187
187
expect ( actual . body ) . toBe ( body ) ;
188
188
} ) ;
189
189
190
+ test ( 'allows separating -side nodes- by setting parserOpts.fieldPattern' , async ( ) => {
191
+ const message =
192
+ 'type(scope): subject\n\nbody text\n-authorName-\nrenovate[bot]' ;
193
+ const changelogOpts = {
194
+ parserOpts : {
195
+ fieldPattern : / ^ - ( .* ) - $ / ,
196
+ } ,
197
+ } ;
198
+ const actual = await parse ( message , undefined , changelogOpts . parserOpts ) ;
199
+
200
+ expect ( actual . body ) . toBe ( 'body text' ) ;
201
+ expect ( actual ) . toHaveProperty ( 'authorName' , 'renovate[bot]' ) ;
202
+ } ) ;
203
+
190
204
test ( 'parses references leading subject' , async ( ) => {
191
205
const message = '#1 some subject' ;
192
206
const opts = await require ( 'conventional-changelog-angular' ) ;
0 commit comments