@@ -853,12 +853,13 @@ test('successful test with logs', t => {
853
853
854
854
const actualOutput = reporter . test ( {
855
855
title : 'successful test' ,
856
- logs : [ 'log message 1' , 'log message 2' ]
856
+ logs : [ 'log message 1\nwith a newline ' , 'log message 2' ]
857
857
} , { } ) ;
858
858
859
859
const expectedOutput = [
860
860
' ' + chalk . green ( figures . tick ) + ' successful test' ,
861
861
' ' + chalk . magenta ( figures . info ) + ' ' + chalk . gray ( 'log message 1' ) ,
862
+ ' ' + chalk . gray ( 'with a newline' ) ,
862
863
' ' + chalk . magenta ( figures . info ) + ' ' + chalk . gray ( 'log message 2' )
863
864
] . join ( '\n' ) ;
864
865
@@ -872,12 +873,13 @@ test('failed test with logs', t => {
872
873
const actualOutput = reporter . test ( {
873
874
title : 'failed test' ,
874
875
error : new Error ( 'failure' ) ,
875
- logs : [ 'log message 1' , 'log message 2' ]
876
+ logs : [ 'log message 1\nwith a newline ' , 'log message 2' ]
876
877
} , { } ) ;
877
878
878
879
const expectedOutput = [
879
880
' ' + chalk . red ( figures . cross ) + ' failed test ' + chalk . red ( 'failure' ) ,
880
881
' ' + chalk . magenta ( figures . info ) + ' ' + chalk . gray ( 'log message 1' ) ,
882
+ ' ' + chalk . gray ( 'with a newline' ) ,
881
883
' ' + chalk . magenta ( figures . info ) + ' ' + chalk . gray ( 'log message 2' )
882
884
] . join ( '\n' ) ;
883
885
@@ -902,7 +904,7 @@ test('results with errors and logs', t => {
902
904
runStatus . failCount = 1 ;
903
905
runStatus . tests = [ {
904
906
title : 'fail one' ,
905
- logs : [ 'log from failed test' , 'another log from failed test' ] ,
907
+ logs : [ 'log from failed test\nwith a newline ' , 'another log from failed test' ] ,
906
908
error : error1
907
909
} ] ;
908
910
@@ -913,6 +915,7 @@ test('results with errors and logs', t => {
913
915
'' ,
914
916
' ' + chalk . bold . white ( 'fail one' ) ,
915
917
' ' + chalk . magenta ( figures . info ) + ' ' + chalk . gray ( 'log from failed test' ) ,
918
+ ' ' + chalk . gray ( 'with a newline' ) ,
916
919
' ' + chalk . magenta ( figures . info ) + ' ' + chalk . gray ( 'another log from failed test' ) ,
917
920
'' ,
918
921
' ' + chalk . grey ( `${ error1 . source . file } :${ error1 . source . line } ` ) ,
0 commit comments