@@ -230,7 +230,7 @@ test('results with passing tests', t => {
230
230
const actualOutput = reporter . finish ( runStatus ) ;
231
231
const expectedOutput = [
232
232
'' ,
233
- ' ' + colors . green ( '1 test passed' ) + time ,
233
+ ' ' + colors . green ( '1 test passed' ) ,
234
234
''
235
235
] . join ( '\n' ) ;
236
236
@@ -251,7 +251,7 @@ test('results with passing known failure tests', t => {
251
251
const actualOutput = reporter . finish ( runStatus ) ;
252
252
const expectedOutput = [
253
253
'' ,
254
- ' ' + colors . green ( '1 test passed' ) + time ,
254
+ ' ' + colors . green ( '1 test passed' ) ,
255
255
' ' + colors . red ( '1 known failure' ) ,
256
256
'' ,
257
257
'' ,
@@ -272,7 +272,7 @@ test('results with skipped tests', t => {
272
272
const actualOutput = reporter . finish ( runStatus ) ;
273
273
const expectedOutput = [
274
274
'' ,
275
- ' ' + colors . green ( '1 test passed' ) + time ,
275
+ ' ' + colors . green ( '1 test passed' ) ,
276
276
' ' + colors . yellow ( '1 test skipped' ) ,
277
277
''
278
278
] . join ( '\n' ) ;
@@ -290,7 +290,7 @@ test('results with todo tests', t => {
290
290
const actualOutput = reporter . finish ( runStatus ) ;
291
291
const expectedOutput = [
292
292
'' ,
293
- ' ' + colors . green ( '1 test passed' ) + time ,
293
+ ' ' + colors . green ( '1 test passed' ) ,
294
294
' ' + colors . blue ( '1 test todo' ) ,
295
295
''
296
296
] . join ( '\n' ) ;
@@ -308,7 +308,7 @@ test('results with passing tests and rejections', t => {
308
308
const actualOutput = reporter . finish ( runStatus ) ;
309
309
const expectedOutput = [
310
310
'' ,
311
- ' ' + colors . green ( '1 test passed' ) + time ,
311
+ ' ' + colors . green ( '1 test passed' ) ,
312
312
' ' + colors . red ( '1 unhandled rejection' ) ,
313
313
''
314
314
] . join ( '\n' ) ;
@@ -326,7 +326,7 @@ test('results with passing tests and exceptions', t => {
326
326
const actualOutput = reporter . finish ( runStatus ) ;
327
327
const expectedOutput = [
328
328
'' ,
329
- ' ' + colors . green ( '1 test passed' ) + time ,
329
+ ' ' + colors . green ( '1 test passed' ) ,
330
330
' ' + colors . red ( '1 uncaught exception' ) ,
331
331
''
332
332
] . join ( '\n' ) ;
@@ -345,7 +345,7 @@ test('results with passing tests, rejections and exceptions', t => {
345
345
const actualOutput = reporter . finish ( runStatus ) ;
346
346
const expectedOutput = [
347
347
'' ,
348
- ' ' + colors . green ( '1 test passed' ) + time ,
348
+ ' ' + colors . green ( '1 test passed' ) ,
349
349
' ' + colors . red ( '1 unhandled rejection' ) ,
350
350
' ' + colors . red ( '1 uncaught exception' ) ,
351
351
''
@@ -403,7 +403,7 @@ test('results with errors', t => {
403
403
const output = reporter . finish ( runStatus ) ;
404
404
compareLineOutput ( t , output , flatten ( [
405
405
'' ,
406
- ' ' + colors . red ( '1 test failed' ) + time ,
406
+ ' ' + colors . red ( '1 test failed' ) ,
407
407
'' ,
408
408
' ' + colors . boldWhite ( 'fail one' ) ,
409
409
' ' + colors . gray ( `${ error1 . source . file } :${ error1 . source . line } ` ) ,
@@ -488,7 +488,7 @@ test('results with errors and disabled code excerpts', t => {
488
488
const output = reporter . finish ( runStatus ) ;
489
489
compareLineOutput ( t , output , flatten ( [
490
490
'' ,
491
- ' ' + colors . red ( '1 test failed' ) + time ,
491
+ ' ' + colors . red ( '1 test failed' ) ,
492
492
'' ,
493
493
' ' + colors . boldWhite ( 'fail one' ) ,
494
494
'' ,
@@ -560,7 +560,7 @@ test('results with errors and disabled code excerpts', t => {
560
560
const output = reporter . finish ( runStatus ) ;
561
561
compareLineOutput ( t , output , flatten ( [
562
562
'' ,
563
- ' ' + colors . red ( '1 test failed' ) + time ,
563
+ ' ' + colors . red ( '1 test failed' ) ,
564
564
'' ,
565
565
' ' + colors . boldWhite ( 'fail one' ) ,
566
566
' ' + colors . gray ( `${ error1 . source . file } :${ error1 . source . line } ` ) ,
@@ -610,7 +610,7 @@ test('results when fail-fast is enabled', t => {
610
610
611
611
const output = reporter . finish ( runStatus ) ;
612
612
const expectedOutput = [
613
- '\n ' + colors . red ( '1 test failed' ) + time ,
613
+ '\n ' + colors . red ( '1 test failed' ) ,
614
614
'\n' ,
615
615
'\n ' + colors . magenta ( '`--fail-fast` is on. At least 1 test was skipped.' ) ,
616
616
'\n'
@@ -632,7 +632,7 @@ test('results when fail-fast is enabled with multiple skipped tests', t => {
632
632
633
633
const output = reporter . finish ( runStatus ) ;
634
634
const expectedOutput = [
635
- '\n ' + colors . red ( '1 test failed' ) + time ,
635
+ '\n ' + colors . red ( '1 test failed' ) ,
636
636
'\n' ,
637
637
'\n ' + colors . magenta ( '`--fail-fast` is on. At least 2 tests were skipped.' ) ,
638
638
'\n'
@@ -653,7 +653,7 @@ test('results without fail-fast if no failing tests', t => {
653
653
const output = reporter . finish ( runStatus ) ;
654
654
const expectedOutput = [
655
655
'' ,
656
- ' ' + colors . green ( '1 test passed' ) + time ,
656
+ ' ' + colors . green ( '1 test passed' ) ,
657
657
''
658
658
] . join ( '\n' ) ;
659
659
@@ -674,7 +674,7 @@ test('results without fail-fast if no skipped tests', t => {
674
674
const output = reporter . finish ( runStatus ) ;
675
675
const expectedOutput = [
676
676
'' ,
677
- ' ' + colors . red ( '1 test failed' ) + time ,
677
+ ' ' + colors . red ( '1 test failed' ) ,
678
678
''
679
679
] . join ( '\n' ) ;
680
680
@@ -693,7 +693,7 @@ test('results with 1 previous failure', t => {
693
693
const output = reporter . finish ( runStatus ) ;
694
694
compareLineOutput ( t , output , [
695
695
'' ,
696
- ' ' + colors . green ( '1 test passed' ) + time ,
696
+ ' ' + colors . green ( '1 test passed' ) ,
697
697
' ' + colors . red ( '1 uncaught exception' ) ,
698
698
' ' + colors . red ( '1 previous failure in test files that were not rerun' ) ,
699
699
''
@@ -712,7 +712,7 @@ test('results with 2 previous failures', t => {
712
712
const output = reporter . finish ( runStatus ) ;
713
713
compareLineOutput ( t , output , [
714
714
'' ,
715
- ' ' + colors . green ( '1 test passed' ) + time ,
715
+ ' ' + colors . green ( '1 test passed' ) ,
716
716
' ' + colors . red ( '1 uncaught exception' ) ,
717
717
' ' + colors . red ( '2 previous failures in test files that were not rerun' ) ,
718
718
''
@@ -760,7 +760,7 @@ test('results when hasExclusive is enabled, but there are no known remaining tes
760
760
const output = reporter . finish ( runStatus ) ;
761
761
const expectedOutput = [
762
762
'' ,
763
- ' ' + colors . green ( '1 test passed' ) + time ,
763
+ ' ' + colors . green ( '1 test passed' ) ,
764
764
''
765
765
] . join ( '\n' ) ;
766
766
@@ -779,7 +779,7 @@ test('results when hasExclusive is enabled, but there is one remaining tests', t
779
779
780
780
const output = reporter . finish ( runStatus ) ;
781
781
const expectedOutput = [
782
- '\n ' + colors . green ( '1 test passed' ) + time ,
782
+ '\n ' + colors . green ( '1 test passed' ) ,
783
783
'\n' ,
784
784
'\n ' + colors . magenta ( 'The .only() modifier is used in some tests. 1 test was not run' ) ,
785
785
'\n'
@@ -800,7 +800,7 @@ test('results when hasExclusive is enabled, but there are multiple remaining tes
800
800
801
801
const output = reporter . finish ( runStatus ) ;
802
802
const expectedOutput = [
803
- '\n ' + colors . green ( '1 test passed' ) + time ,
803
+ '\n ' + colors . green ( '1 test passed' ) ,
804
804
'\n' ,
805
805
'\n ' + colors . magenta ( 'The .only() modifier is used in some tests. 2 tests were not run' ) ,
806
806
'\n'
@@ -811,7 +811,7 @@ test('results when hasExclusive is enabled, but there are multiple remaining tes
811
811
} ) ;
812
812
813
813
test ( 'result when no-color flag is set' , t => {
814
- const reporter = new VerboseReporter ( { color : false } ) ;
814
+ const reporter = new VerboseReporter ( { color : false , watching : true } ) ;
815
815
const runStatus = createRunStatus ( ) ;
816
816
runStatus . hasExclusive = true ;
817
817
runStatus . testCount = 3 ;
@@ -831,6 +831,20 @@ test('result when no-color flag is set', t => {
831
831
t . end ( ) ;
832
832
} ) ;
833
833
834
+ test ( 'timestamp added when watching is enabled' , t => {
835
+ const reporter = new VerboseReporter ( { color : true , watching : true } ) ;
836
+ const runStatus = createRunStatus ( ) ;
837
+ runStatus . testCount = 1 ;
838
+ runStatus . passCount = 1 ;
839
+ runStatus . failCount = 0 ;
840
+
841
+ const actualOutput = reporter . finish ( runStatus ) ;
842
+ const expectedOutput = `\n ${ colors . green ( '1 test passed' ) + time } \n` ;
843
+
844
+ t . is ( actualOutput , expectedOutput ) ;
845
+ t . end ( ) ;
846
+ } ) ;
847
+
834
848
test ( 'successful test with logs' , t => {
835
849
const reporter = createReporter ( ) ;
836
850
@@ -892,7 +906,7 @@ test('results with errors and logs', t => {
892
906
const output = reporter . finish ( runStatus ) ;
893
907
compareLineOutput ( t , output , flatten ( [
894
908
'' ,
895
- ' ' + colors . red ( '1 test failed' ) + time ,
909
+ ' ' + colors . red ( '1 test failed' ) ,
896
910
'' ,
897
911
' ' + colors . boldWhite ( 'fail one' ) ,
898
912
' ' + colors . magenta ( figures . info ) + ' ' + colors . gray ( 'log from failed test' ) ,
0 commit comments