File tree 2 files changed +24
-2
lines changed
2 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,29 @@ test('returns empty summary if verbose', () => {
35
35
expect ( actual ) . toContain ( '0 problems, 0 warnings' ) ;
36
36
} ) ;
37
37
38
+ test ( 'returns empty summary with full commit message if verbose' , ( ) => {
39
+ const actual = format (
40
+ {
41
+ results : [
42
+ {
43
+ errors : [ ] ,
44
+ warnings : [ ] ,
45
+ input :
46
+ 'feat(cli): this is a valid header\n\nThis is a valid body\n\nSigned-off-by: tester' ,
47
+ } ,
48
+ ] ,
49
+ } ,
50
+ {
51
+ verbose : true ,
52
+ color : false ,
53
+ }
54
+ ) ;
55
+
56
+ expect ( actual ) . toStrictEqual (
57
+ '⧗ input: feat(cli): this is a valid header\n\nThis is a valid body\n\nSigned-off-by: tester\n✔ found 0 problems, 0 warnings'
58
+ ) ;
59
+ } ) ;
60
+
38
61
test ( 'returns a correct summary of empty .errors and .warnings' , ( ) => {
39
62
const actualError = format ( {
40
63
results : [
Original file line number Diff line number Diff line change @@ -42,9 +42,8 @@ function formatInput(
42
42
43
43
const sign = '⧗' ;
44
44
const decoration = enabled ? chalk . gray ( sign ) : sign ;
45
- const commitText = errors . length > 0 ? input : input . split ( '\n' ) [ 0 ] ;
46
45
47
- const decoratedInput = enabled ? chalk . bold ( commitText ) : commitText ;
46
+ const decoratedInput = enabled ? chalk . bold ( input ) : input ;
48
47
const hasProblems = errors . length > 0 || warnings . length > 0 ;
49
48
50
49
return options . verbose || hasProblems
You can’t perform that action at this time.
0 commit comments