File tree Expand file tree Collapse file tree 2 files changed +24
-2
lines changed Expand file tree Collapse file tree 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', () => {
3535 expect ( actual ) . toContain ( '0 problems, 0 warnings' ) ;
3636} ) ;
3737
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+
3861test ( 'returns a correct summary of empty .errors and .warnings' , ( ) => {
3962 const actualError = format ( {
4063 results : [
Original file line number Diff line number Diff line change @@ -42,9 +42,8 @@ function formatInput(
4242
4343 const sign = '⧗' ;
4444 const decoration = enabled ? chalk . gray ( sign ) : sign ;
45- const commitText = errors . length > 0 ? input : input . split ( '\n' ) [ 0 ] ;
4645
47- const decoratedInput = enabled ? chalk . bold ( commitText ) : commitText ;
46+ const decoratedInput = enabled ? chalk . bold ( input ) : input ;
4847 const hasProblems = errors . length > 0 || warnings . length > 0 ;
4948
5049 return options . verbose || hasProblems
You can’t perform that action at this time.
0 commit comments