@@ -482,6 +482,24 @@ test('should work with relative formatter path', async () => {
482
482
expect ( actual . exitCode ) . toBe ( 0 ) ;
483
483
} ) ;
484
484
485
+ test ( 'strict: should exit with 3 on error' , async ( ) => {
486
+ const cwd = await gitBootstrap ( 'fixtures/warning' ) ;
487
+ const actual = await cli ( [ '--strict' ] , { cwd} ) ( 'foo: abcdef' ) ;
488
+ expect ( actual . exitCode ) . toBe ( 3 ) ;
489
+ } ) ;
490
+
491
+ test ( 'strict: should exit with 2 on warning' , async ( ) => {
492
+ const cwd = await gitBootstrap ( 'fixtures/warning' ) ;
493
+ const actual = await cli ( [ '--strict' ] , { cwd} ) ( 'feat: abcdef' ) ;
494
+ expect ( actual . exitCode ) . toBe ( 2 ) ;
495
+ } ) ;
496
+
497
+ test ( 'strict: should exit with 0 on success' , async ( ) => {
498
+ const cwd = await gitBootstrap ( 'fixtures/warning' ) ;
499
+ const actual = await cli ( [ '--strict' ] , { cwd} ) ( 'feat: abc' ) ;
500
+ expect ( actual . exitCode ) . toBe ( 0 ) ;
501
+ } ) ;
502
+
485
503
test ( 'should print help' , async ( ) => {
486
504
const cwd = await gitBootstrap ( 'fixtures/default' ) ;
487
505
const actual = await cli ( [ '--help' ] , { cwd} ) ( ) ;
@@ -507,7 +525,7 @@ test('should print help', async () => {
507
525
-f, --from lower end of the commit range to lint; applies if
508
526
edit=false [string]
509
527
--git-log-args addditional git log arguments as space separated string,
510
- example \ '--first-parent --cherry-pick\ ' [string]
528
+ example '--first-parent --cherry-pick' [string]
511
529
-o, --format output format of the results [string]
512
530
-p, --parser-preset configuration preset to use for
513
531
conventional-commits-parser [string]
@@ -516,6 +534,8 @@ test('should print help', async () => {
516
534
edit=false [string]
517
535
-V, --verbose enable verbose output for reports without problems
518
536
[boolean]
537
+ -s, --strict enable strict mode; result code 2 for warnings, 3 for
538
+ errors [boolean]
519
539
-v, --version display version information [boolean]
520
540
-h, --help Show help [boolean]"
521
541
` ) ;
0 commit comments