@@ -115,7 +115,7 @@ test('should produce help for problems', async () => {
115
115
const result = cli ( [ ] , { cwd} ) ( 'foo: bar' ) ;
116
116
const output = await result ;
117
117
expect ( output . stdout . trim ( ) ) . toContain (
118
- 'Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint'
118
+ 'Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint' ,
119
119
) ;
120
120
expect ( result . exitCode ) . toBe ( ExitCode . CommitlintErrorDefault ) ;
121
121
} ) ;
@@ -124,11 +124,11 @@ test('should produce help for problems with correct helpurl', async () => {
124
124
const cwd = await gitBootstrap ( 'fixtures/default' ) ;
125
125
const result = cli (
126
126
[ '-H https://github.com/conventional-changelog/commitlint/#testhelpurl' ] ,
127
- { cwd}
127
+ { cwd} ,
128
128
) ( 'foo: bar' ) ;
129
129
const output = await result ;
130
130
expect ( output . stdout . trim ( ) ) . toContain (
131
- 'Get help: https://github.com/conventional-changelog/commitlint/#testhelpurl'
131
+ 'Get help: https://github.com/conventional-changelog/commitlint/#testhelpurl' ,
132
132
) ;
133
133
expect ( result . exitCode ) . toBe ( ExitCode . CommitlintErrorDefault ) ;
134
134
} ) ;
@@ -177,7 +177,7 @@ test('should output help URL defined in config file', async () => {
177
177
const result = cli ( [ ] , { cwd} ) ( 'foo: bar' ) ;
178
178
const output = await result ;
179
179
expect ( output . stdout . trim ( ) ) . toContain (
180
- 'Get help: https://www.example.com/foo'
180
+ 'Get help: https://www.example.com/foo' ,
181
181
) ;
182
182
expect ( result . exitCode ) . toBe ( ExitCode . CommitlintErrorDefault ) ;
183
183
} ) ;
@@ -230,7 +230,7 @@ test('should work with husky via commitlint -e $GIT_PARAMS', async () => {
230
230
const cwd = await gitBootstrap ( 'fixtures/husky/integration' ) ;
231
231
await writePkg (
232
232
{ husky : { hooks : { 'commit-msg' : `'${ bin } ' -e $GIT_PARAMS` } } } ,
233
- { cwd}
233
+ { cwd} ,
234
234
) ;
235
235
236
236
// await x('npm', ['install'], { nodeOptions: {cwd}}); // npm install is failing on windows machines
@@ -245,7 +245,7 @@ test('should work with husky via commitlint -e %GIT_PARAMS%', async () => {
245
245
const cwd = await gitBootstrap ( 'fixtures/husky/integration' ) ;
246
246
await writePkg (
247
247
{ husky : { hooks : { 'commit-msg' : `'${ bin } ' -e %GIT_PARAMS%` } } } ,
248
- { cwd}
248
+ { cwd} ,
249
249
) ;
250
250
251
251
// await x('npm', ['install'], { nodeOptions: {cwd}}); // npm install is failing on windows machines
@@ -260,7 +260,7 @@ test('should work with husky via commitlint -e $HUSKY_GIT_PARAMS', async () => {
260
260
const cwd = await gitBootstrap ( 'fixtures/husky/integration' ) ;
261
261
await writePkg (
262
262
{ husky : { hooks : { 'commit-msg' : `'${ bin } ' -e $HUSKY_GIT_PARAMS` } } } ,
263
- { cwd}
263
+ { cwd} ,
264
264
) ;
265
265
266
266
// await x('npm', ['install'], { nodeOptions: {cwd}}); // npm install is failing on windows machines
@@ -275,7 +275,7 @@ test('should work with husky via commitlint -e %HUSKY_GIT_PARAMS%', async () =>
275
275
const cwd = await gitBootstrap ( 'fixtures/husky/integration' ) ;
276
276
await writePkg (
277
277
{ husky : { hooks : { 'commit-msg' : `'${ bin } ' -e %HUSKY_GIT_PARAMS%` } } } ,
278
- { cwd}
278
+ { cwd} ,
279
279
) ;
280
280
281
281
// await x('npm', ['install'], { nodeOptions: {cwd}}); // npm install is failing on windows machines
@@ -301,7 +301,7 @@ test('should allow reading of environment variables for edit file, failing if in
301
301
const cwd = await gitBootstrap ( 'fixtures/simple' ) ;
302
302
await fs . writeFile (
303
303
path . join ( cwd , 'commit-msg-file' ) ,
304
- 'foo: bar\n\nFoo bar bizz buzz.\n\nCloses #123.'
304
+ 'foo: bar\n\nFoo bar bizz buzz.\n\nCloses #123.' ,
305
305
) ;
306
306
const result = cli ( [ '--env' , 'variable' ] , {
307
307
cwd,
@@ -314,7 +314,7 @@ test('should allow reading of environment variables for edit file, failing if in
314
314
test ( 'should pick up parser preset and fail accordingly' , async ( ) => {
315
315
const cwd = await gitBootstrap ( 'fixtures/parser-preset' ) ;
316
316
const result = cli ( [ '--parser-preset' , './parser-preset' ] , { cwd} ) (
317
- 'type(scope): subject'
317
+ 'type(scope): subject' ,
318
318
) ;
319
319
const output = await result ;
320
320
expect ( output . stdout . trim ( ) ) . toContain ( 'may not be empty' ) ;
@@ -324,7 +324,7 @@ test('should pick up parser preset and fail accordingly', async () => {
324
324
test ( 'should pick up parser preset and succeed accordingly' , async ( ) => {
325
325
const cwd = await gitBootstrap ( 'fixtures/parser-preset' ) ;
326
326
const result = cli ( [ '--parser-preset' , './parser-preset' ] , { cwd} ) (
327
- '----type(scope): subject'
327
+ '----type(scope): subject' ,
328
328
) ;
329
329
await result ;
330
330
expect ( result . exitCode ) . toBe ( ExitCode . CommitlintDefault ) ;
@@ -396,7 +396,7 @@ test("it doesn't use parserOpts.commentChar when using edit mode", async () => {
396
396
const cwd = await gitBootstrap ( 'fixtures/comment-char' ) ;
397
397
await fs . writeFile (
398
398
path . join ( cwd , '.git' , 'COMMIT_EDITMSG' ) ,
399
- 'header: foo\n\n$body\n'
399
+ 'header: foo\n\n$body\n' ,
400
400
) ;
401
401
402
402
const result = cli ( [ '--edit' , '.git/COMMIT_EDITMSG' ] , { cwd} ) ( ) ;
@@ -412,7 +412,7 @@ test('it uses core.commentChar git config when using edit mode', async () => {
412
412
} ) ;
413
413
await fs . writeFile (
414
414
path . join ( cwd , '.git' , 'COMMIT_EDITMSG' ) ,
415
- 'header: foo\n\n$body\n'
415
+ 'header: foo\n\n$body\n' ,
416
416
) ;
417
417
418
418
const result = cli ( [ '--edit' , '.git/COMMIT_EDITMSG' ] , { cwd} ) ( ) ;
@@ -425,7 +425,7 @@ test('it falls back to # for core.commentChar when using edit mode', async () =>
425
425
const cwd = await gitBootstrap ( 'fixtures/comment-char' ) ;
426
426
await fs . writeFile (
427
427
path . join ( cwd , '.git' , 'COMMIT_EDITMSG' ) ,
428
- 'header: foo\n\n#body\n'
428
+ 'header: foo\n\n#body\n' ,
429
429
) ;
430
430
431
431
const result = cli ( [ '--edit' , '.git/COMMIT_EDITMSG' ] , { cwd} ) ( ) ;
@@ -468,7 +468,7 @@ test('should fail for invalid formatters from configuration', async () => {
468
468
const result = cli ( [ ] , { cwd} ) ( 'foo: bar' ) ;
469
469
const output = await result ;
470
470
expect ( output . stderr ) . toContain (
471
- 'Using format custom-formatter, but cannot find the module'
471
+ 'Using format custom-formatter, but cannot find the module' ,
472
472
) ;
473
473
expect ( output . stdout . trim ( ) ) . toEqual ( '' ) ;
474
474
expect ( result . exitCode ) . toBe ( ExitCode . CommitlintErrorDefault ) ;
@@ -514,7 +514,7 @@ test('should fail for invalid formatters from flags', async () => {
514
514
const result = cli ( [ '--format' , 'through-flag' ] , { cwd} ) ( 'foo: bar' ) ;
515
515
const output = await result ;
516
516
expect ( output . stderr ) . toContain (
517
- 'Using format through-flag, but cannot find the module'
517
+ 'Using format through-flag, but cannot find the module' ,
518
518
) ;
519
519
expect ( output . stdout . trim ( ) ) . toEqual ( '' ) ;
520
520
expect ( result . exitCode ) . toBe ( ExitCode . CommitlintErrorDefault ) ;
@@ -523,11 +523,11 @@ test('should fail for invalid formatters from flags', async () => {
523
523
test ( 'should work with absolute formatter path' , async ( ) => {
524
524
const formatterPath = path . resolve (
525
525
__dirname ,
526
- '../fixtures/custom-formatter/formatters/custom.js'
526
+ '../fixtures/custom-formatter/formatters/custom.js' ,
527
527
) ;
528
528
const cwd = await gitBootstrap ( 'fixtures/custom-formatter' ) ;
529
529
const result = cli ( [ '--format' , formatterPath ] , { cwd} ) (
530
- 'test: this should work'
530
+ 'test: this should work' ,
531
531
) ;
532
532
const output = await result ;
533
533
expect ( output . stdout . trim ( ) ) . toContain ( 'custom-formatter-ok' ) ;
@@ -537,10 +537,10 @@ test('should work with absolute formatter path', async () => {
537
537
test ( 'should work with relative formatter path' , async ( ) => {
538
538
const cwd = path . resolve (
539
539
await gitBootstrap ( 'fixtures/custom-formatter' ) ,
540
- './formatters'
540
+ './formatters' ,
541
541
) ;
542
542
const result = cli ( [ '--format' , './custom.js' ] , { cwd} ) (
543
- 'test: this should work'
543
+ 'test: this should work' ,
544
544
) ;
545
545
const output = await result ;
546
546
expect ( output . stdout . trim ( ) ) . toContain ( 'custom-formatter-ok' ) ;
@@ -665,7 +665,7 @@ describe('should print config', () => {
665
665
const result = cli ( [ '--print-config=json' , '--no-color' ] , { cwd} ) ( ) ;
666
666
const output = await result ;
667
667
expect ( output . stdout . trim ( ) ) . toMatchInlineSnapshot (
668
- `"{"extends":[],"formatter":"@commitlint/format","plugins":{},"rules":{"type-enum":[2,"never",["foo"]]},"helpUrl":"https://github.com/conventional-changelog/commitlint/#what-is-commitlint","prompt":{}}"`
668
+ `"{"extends":[],"formatter":"@commitlint/format","plugins":{},"rules":{"type-enum":[2,"never",["foo"]]},"helpUrl":"https://github.com/conventional-changelog/commitlint/#what-is-commitlint","prompt":{}}"` ,
669
669
) ;
670
670
} ) ;
671
671
} ) ;
0 commit comments