@@ -145,7 +145,10 @@ test('Return "major" if there is a breaking change, using default releaseRules',
145
145
} ) ;
146
146
147
147
test ( 'Return "major" if there is a "conventionalcommits" breaking change, using default releaseRules' , async t => {
148
- const commits = [ { hash : '123' , message : 'fix: First fix' } , { hash : '456' , message : 'feat!: Breaking change feature' } ] ;
148
+ const commits = [
149
+ { hash : '123' , message : 'fix: First fix' } ,
150
+ { hash : '456' , message : 'feat!: Breaking change feature' } ,
151
+ ] ;
149
152
const releaseType = await analyzeCommits ( { preset : 'conventionalcommits' } , { cwd, commits, logger : t . context . logger } ) ;
150
153
151
154
t . is ( releaseType , 'major' ) ;
@@ -174,7 +177,13 @@ test('Return "patch" if there is only types set to "patch", using default releas
174
177
test ( 'Allow to use glob in "releaseRules" configuration' , async t => {
175
178
const commits = [ { message : 'Chore: First chore (fixes #123)' } , { message : 'Docs: update README (fixes #456)' } ] ;
176
179
const releaseType = await analyzeCommits (
177
- { preset : 'eslint' , releaseRules : [ { tag : 'Chore' , release : 'patch' } , { message : '*README*' , release : 'minor' } ] } ,
180
+ {
181
+ preset : 'eslint' ,
182
+ releaseRules : [
183
+ { tag : 'Chore' , release : 'patch' } ,
184
+ { message : '*README*' , release : 'minor' } ,
185
+ ] ,
186
+ } ,
178
187
{ cwd, commits, logger : t . context . logger }
179
188
) ;
180
189
@@ -187,7 +196,10 @@ test('Allow to use glob in "releaseRules" configuration', async t => {
187
196
} ) ;
188
197
189
198
test ( 'Return "null" if no rule match' , async t => {
190
- const commits = [ { hash : '123' , message : 'doc: doc update' } , { hash : '456' , message : 'chore: Chore' } ] ;
199
+ const commits = [
200
+ { hash : '123' , message : 'doc: doc update' } ,
201
+ { hash : '456' , message : 'chore: Chore' } ,
202
+ ] ;
191
203
const releaseType = await analyzeCommits ( { } , { cwd, commits, logger : t . context . logger } ) ;
192
204
193
205
t . is ( releaseType , null ) ;
@@ -204,7 +216,13 @@ test('Process rules in order and apply highest match', async t => {
204
216
{ hash : '456' , message : 'Docs: update README (fixes #456)' } ,
205
217
] ;
206
218
const releaseType = await analyzeCommits (
207
- { preset : 'eslint' , releaseRules : [ { tag : 'Chore' , release : 'minor' } , { tag : 'Chore' , release : 'patch' } ] } ,
219
+ {
220
+ preset : 'eslint' ,
221
+ releaseRules : [
222
+ { tag : 'Chore' , release : 'minor' } ,
223
+ { tag : 'Chore' , release : 'patch' } ,
224
+ ] ,
225
+ } ,
208
226
{ cwd, commits, logger : t . context . logger }
209
227
) ;
210
228
@@ -222,7 +240,13 @@ test('Process rules in order and apply highest match from config even if default
222
240
{ hash : '456' , message : 'Docs: update README (fixes #456) \n\n BREAKING CHANGE: break something' } ,
223
241
] ;
224
242
const releaseType = await analyzeCommits (
225
- { preset : 'eslint' , releaseRules : [ { tag : 'Chore' , release : 'patch' } , { breaking : true , release : 'minor' } ] } ,
243
+ {
244
+ preset : 'eslint' ,
245
+ releaseRules : [
246
+ { tag : 'Chore' , release : 'patch' } ,
247
+ { breaking : true , release : 'minor' } ,
248
+ ] ,
249
+ } ,
226
250
{ cwd, commits, logger : t . context . logger }
227
251
) ;
228
252
@@ -235,7 +259,10 @@ test('Process rules in order and apply highest match from config even if default
235
259
} ) ;
236
260
237
261
test ( 'Allow to overwrite default "releaseRules" with "false"' , async t => {
238
- const commits = [ { hash : '123' , message : 'chore: First chore' } , { hash : '456' , message : 'feat: new feature' } ] ;
262
+ const commits = [
263
+ { hash : '123' , message : 'chore: First chore' } ,
264
+ { hash : '456' , message : 'feat: new feature' } ,
265
+ ] ;
239
266
const releaseType = await analyzeCommits (
240
267
{ preset : 'angular' , releaseRules : [ { type : 'feat' , release : false } ] } ,
241
268
{ cwd, commits, logger : t . context . logger }
@@ -250,9 +277,18 @@ test('Allow to overwrite default "releaseRules" with "false"', async t => {
250
277
} ) ;
251
278
252
279
test ( 'Commits with an associated custom release type have higher priority than commits with release "false"' , async t => {
253
- const commits = [ { hash : '123' , message : 'feat: Feature to skip' } , { hash : '456' , message : 'docs: update README' } ] ;
280
+ const commits = [
281
+ { hash : '123' , message : 'feat: Feature to skip' } ,
282
+ { hash : '456' , message : 'docs: update README' } ,
283
+ ] ;
254
284
const releaseType = await analyzeCommits (
255
- { preset : 'angular' , releaseRules : [ { type : 'feat' , release : false } , { type : 'docs' , release : 'patch' } ] } ,
285
+ {
286
+ preset : 'angular' ,
287
+ releaseRules : [
288
+ { type : 'feat' , release : false } ,
289
+ { type : 'docs' , release : 'patch' } ,
290
+ ] ,
291
+ } ,
256
292
{ cwd, commits, logger : t . context . logger }
257
293
) ;
258
294
@@ -265,7 +301,10 @@ test('Commits with an associated custom release type have higher priority than c
265
301
} ) ;
266
302
267
303
test ( 'Commits with an associated default release type have higher priority than commits with release "false"' , async t => {
268
- const commits = [ { hash : '123' , message : 'feat: new feature' } , { hash : '456' , message : 'fix: new Fix' } ] ;
304
+ const commits = [
305
+ { hash : '123' , message : 'feat: new feature' } ,
306
+ { hash : '456' , message : 'fix: new Fix' } ,
307
+ ] ;
269
308
const releaseType = await analyzeCommits (
270
309
{ preset : 'angular' , releaseRules : [ { type : 'feat' , release : false } ] } ,
271
310
{ cwd, commits, logger : t . context . logger }
@@ -280,7 +319,10 @@ test('Commits with an associated default release type have higher priority than
280
319
} ) ;
281
320
282
321
test ( 'Use default "releaseRules" if none of provided match' , async t => {
283
- const commits = [ { hash : '123' , message : 'Chore: First chore' } , { hash : '456' , message : 'Update: new feature' } ] ;
322
+ const commits = [
323
+ { hash : '123' , message : 'Chore: First chore' } ,
324
+ { hash : '456' , message : 'Update: new feature' } ,
325
+ ] ;
284
326
const releaseType = await analyzeCommits (
285
327
{ preset : 'eslint' , releaseRules : [ { tag : 'Chore' , release : 'patch' } ] } ,
286
328
{ cwd, commits, logger : t . context . logger }
@@ -295,7 +337,10 @@ test('Use default "releaseRules" if none of provided match', async t => {
295
337
} ) ;
296
338
297
339
test ( 'Filter out empty commits' , async t => {
298
- const commits = [ { hash : '123' , message : '' } , { hash : '456' , message : 'fix(scope1): First fix' } ] ;
340
+ const commits = [
341
+ { hash : '123' , message : '' } ,
342
+ { hash : '456' , message : 'fix(scope1): First fix' } ,
343
+ ] ;
299
344
const releaseType = await analyzeCommits ( { } , { cwd, commits, logger : t . context . logger } ) ;
300
345
301
346
t . is ( releaseType , 'patch' ) ;
0 commit comments