@@ -49,7 +49,7 @@ test('passing test', function (t) {
49
49
' ' ,
50
50
' ' + graySpinner + ' passed' ,
51
51
'' ,
52
- ' ' + chalk . green ( '1 passed' )
52
+ ' ' + chalk . green ( '1 passed' )
53
53
] . join ( '\n' ) ;
54
54
55
55
t . is ( actualOutput , expectedOutput ) ;
@@ -68,8 +68,8 @@ test('known failure test', function (t) {
68
68
' ' ,
69
69
' ' + graySpinner + ' ' + chalk . red ( 'known failure' ) ,
70
70
'' ,
71
- ' ' + chalk . green ( '1 passed' ) ,
72
- ' ' + chalk . red ( '1 known failure' )
71
+ ' ' + chalk . green ( '1 passed' ) ,
72
+ ' ' + chalk . red ( '1 known failure' )
73
73
] . join ( '\n' ) ;
74
74
75
75
t . is ( actualOutput , expectedOutput ) ;
@@ -90,7 +90,7 @@ test('failing test', function (t) {
90
90
' ' ,
91
91
' ' + graySpinner + ' ' + chalk . red ( 'failed' ) ,
92
92
'' ,
93
- ' ' + chalk . red ( '1 failed' )
93
+ ' ' + chalk . red ( '1 failed' )
94
94
] . join ( '\n' ) ;
95
95
96
96
t . is ( actualOutput , expectedOutput ) ;
@@ -112,7 +112,7 @@ test('failed known failure test', function (t) {
112
112
' ' ,
113
113
' ' + graySpinner + ' ' + chalk . red ( 'known failure' ) ,
114
114
'' ,
115
- ' ' + chalk . red ( '1 failed' )
115
+ ' ' + chalk . red ( '1 failed' )
116
116
] . join ( '\n' ) ;
117
117
118
118
t . is ( actualOutput , expectedOutput ) ;
@@ -135,8 +135,8 @@ test('passing test after failing', function (t) {
135
135
' ' ,
136
136
' ' + graySpinner + ' passed' ,
137
137
'' ,
138
- ' ' + chalk . green ( '1 passed' ) ,
139
- ' ' + chalk . red ( '1 failed' )
138
+ ' ' + chalk . green ( '1 passed' ) ,
139
+ ' ' + chalk . red ( '1 failed' )
140
140
] . join ( '\n' ) ;
141
141
142
142
t . is ( actualOutput , expectedOutput ) ;
@@ -159,8 +159,8 @@ test('failing test after passing', function (t) {
159
159
' ' ,
160
160
' ' + graySpinner + ' ' + chalk . red ( 'failed' ) ,
161
161
'' ,
162
- ' ' + chalk . green ( '1 passed' ) ,
163
- ' ' + chalk . red ( '1 failed' )
162
+ ' ' + chalk . green ( '1 passed' ) ,
163
+ ' ' + chalk . red ( '1 failed' )
164
164
] . join ( '\n' ) ;
165
165
166
166
t . is ( actualOutput , expectedOutput ) ;
@@ -199,8 +199,8 @@ test('results with passing tests', function (t) {
199
199
200
200
var actualOutput = reporter . finish ( { } ) ;
201
201
var expectedOutput = [
202
- '\n ' + chalk . green ( '1 passed' ) ,
203
- ''
202
+ '\n ' + chalk . green ( '1 passed' ) ,
203
+ '\n '
204
204
] . join ( '\n' ) ;
205
205
206
206
t . is ( actualOutput , expectedOutput ) ;
@@ -221,12 +221,11 @@ test('results with passing known failure tests', function (t) {
221
221
} ;
222
222
var actualOutput = reporter . finish ( runStatus ) ;
223
223
var expectedOutput = [
224
- '\n ' + chalk . green ( '1 passed' ) ,
225
- ' ' + chalk . red ( '1 known failure' ) ,
224
+ '\n ' + chalk . green ( '1 passed' ) ,
225
+ ' ' + chalk . red ( '1 known failure' ) ,
226
226
'' ,
227
- '' ,
228
- ' ' + chalk . red ( '1. known failure' ) ,
229
- ''
227
+ ' ' + chalk . white ( 'known failure' ) ,
228
+ '\n'
230
229
] . join ( '\n' ) ;
231
230
232
231
t . is ( actualOutput , expectedOutput ) ;
@@ -241,8 +240,8 @@ test('results with skipped tests', function (t) {
241
240
242
241
var actualOutput = reporter . finish ( { } ) ;
243
242
var expectedOutput = [
244
- '\n ' + chalk . yellow ( '1 skipped' ) ,
245
- ''
243
+ '\n ' + chalk . yellow ( '1 skipped' ) ,
244
+ '\n '
246
245
] . join ( '\n' ) ;
247
246
248
247
t . is ( actualOutput , expectedOutput ) ;
@@ -257,8 +256,8 @@ test('results with todo tests', function (t) {
257
256
258
257
var actualOutput = reporter . finish ( { } ) ;
259
258
var expectedOutput = [
260
- '\n ' + chalk . blue ( '1 todo' ) ,
261
- ''
259
+ '\n ' + chalk . blue ( '1 todo' ) ,
260
+ '\n '
262
261
] . join ( '\n' ) ;
263
262
264
263
t . is ( actualOutput , expectedOutput ) ;
@@ -273,8 +272,8 @@ test('results with passing skipped tests', function (t) {
273
272
var output = reporter . finish ( { } ) . split ( '\n' ) ;
274
273
275
274
t . is ( output [ 0 ] , '' ) ;
276
- t . is ( output [ 1 ] , ' ' + chalk . green ( '1 passed' ) ) ;
277
- t . is ( output [ 2 ] , ' ' + chalk . yellow ( '1 skipped' ) ) ;
275
+ t . is ( output [ 1 ] , ' ' + chalk . green ( '1 passed' ) ) ;
276
+ t . is ( output [ 2 ] , ' ' + chalk . yellow ( '1 skipped' ) ) ;
278
277
t . is ( output [ 3 ] , '' ) ;
279
278
t . end ( ) ;
280
279
} ) ;
@@ -298,18 +297,16 @@ test('results with passing tests and rejections', function (t) {
298
297
var output = reporter . finish ( runStatus ) ;
299
298
compareLineOutput ( t , output , [
300
299
'' ,
301
- ' ' + chalk . green ( '1 passed' ) ,
302
- ' ' + chalk . red ( '1 rejection' ) ,
303
- '' ,
300
+ ' ' + chalk . green ( '1 passed' ) ,
301
+ ' ' + chalk . red ( '1 rejection' ) ,
304
302
'' ,
305
- ' ' + chalk . red ( '1. Unhandled Rejection') ,
303
+ ' ' + chalk . white ( ' Unhandled Rejection') ,
306
304
/ E r r o r : f a i l u r e / ,
307
305
/ t e s t \/ r e p o r t e r s \/ m i n i \. j s / ,
308
306
compareLineOutput . SKIP_UNTIL_EMPTY_LINE ,
309
307
'' ,
310
- '' ,
311
- ' ' + chalk . red ( '2. Unhandled Rejection' ) ,
312
- ' ' + colors . stack ( 'stack line with trailing whitespace' )
308
+ ' ' + chalk . white ( 'Unhandled Rejection' ) ,
309
+ ' ' + colors . stack ( 'stack line with trailing whitespace' )
313
310
] ) ;
314
311
t . end ( ) ;
315
312
} ) ;
@@ -333,17 +330,15 @@ test('results with passing tests and exceptions', function (t) {
333
330
var output = reporter . finish ( runStatus ) ;
334
331
compareLineOutput ( t , output , [
335
332
'' ,
336
- ' ' + chalk . green ( '1 passed' ) ,
337
- ' ' + chalk . red ( '2 exceptions' ) ,
333
+ ' ' + chalk . green ( '1 passed' ) ,
334
+ ' ' + chalk . red ( '2 exceptions' ) ,
338
335
'' ,
339
- '' ,
340
- ' ' + chalk . red ( '1. Uncaught Exception' ) ,
336
+ ' ' + chalk . white ( 'Uncaught Exception' ) ,
341
337
/ E r r o r : f a i l u r e / ,
342
338
/ t e s t \/ r e p o r t e r s \/ m i n i \. j s / ,
343
339
compareLineOutput . SKIP_UNTIL_EMPTY_LINE ,
344
340
'' ,
345
- '' ,
346
- ' ' + chalk . red ( cross + ' A futuristic test runner' )
341
+ ' ' + chalk . red ( cross + ' A futuristic test runner' )
347
342
] ) ;
348
343
t . end ( ) ;
349
344
} ) ;
@@ -368,20 +363,22 @@ test('results with errors', function (t) {
368
363
} ;
369
364
370
365
var output = reporter . finish ( runStatus ) ;
366
+
367
+ var expectedStack = colors . error ( ' failure two\n' ) + colors . errorStack ( 'stack line with trailing whitespace' ) ;
368
+ expectedStack = expectedStack . split ( '\n' ) ;
369
+
371
370
compareLineOutput ( t , output , [
372
371
'' ,
373
- ' ' + chalk . red ( '1 failed' ) ,
372
+ ' ' + chalk . red ( '1 failed' ) ,
374
373
'' ,
375
- '' ,
376
- ' ' + chalk . red ( '1. failed one' ) ,
374
+ ' ' + chalk . white ( 'failed one' ) ,
377
375
/ f a i l u r e / ,
378
376
/ t e s t \/ r e p o r t e r s \/ m i n i \. j s / ,
379
377
compareLineOutput . SKIP_UNTIL_EMPTY_LINE ,
380
378
'' ,
381
- '' ,
382
- ' ' + chalk . red ( '2. failed two' )
379
+ ' ' + chalk . white ( 'failed two' )
383
380
] . concat (
384
- colors . stack ( ' failure two\n stack line with trailing whitespace' ) . split ( '\n' )
381
+ expectedStack
385
382
) ) ;
386
383
t . end ( ) ;
387
384
} ) ;
@@ -397,8 +394,8 @@ test('results with 1 previous failure', function (t) {
397
394
var output = reporter . finish ( runStatus ) ;
398
395
compareLineOutput ( t , output , [
399
396
'' ,
400
- ' ' + colors . todo ( '1 todo' ) ,
401
- ' ' + colors . error ( '1 previous failure in test files that were not rerun' )
397
+ ' ' + colors . todo ( '1 todo' ) ,
398
+ ' ' + colors . error ( '1 previous failure in test files that were not rerun' )
402
399
] ) ;
403
400
t . end ( ) ;
404
401
} ) ;
@@ -414,8 +411,8 @@ test('results with 2 previous failures', function (t) {
414
411
var output = reporter . finish ( runStatus ) ;
415
412
compareLineOutput ( t , output , [
416
413
'' ,
417
- ' ' + colors . todo ( '1 todo' ) ,
418
- ' ' + colors . error ( '2 previous failures in test files that were not rerun' )
414
+ ' ' + colors . todo ( '1 todo' ) ,
415
+ ' ' + colors . error ( '2 previous failures in test files that were not rerun' )
419
416
] ) ;
420
417
t . end ( ) ;
421
418
} ) ;
@@ -427,7 +424,7 @@ test('empty results after reset', function (t) {
427
424
reporter . reset ( ) ;
428
425
429
426
var output = reporter . finish ( { } ) ;
430
- t . is ( output , '\n' ) ;
427
+ t . is ( output , '\n\n ' ) ;
431
428
t . end ( ) ;
432
429
} ) ;
433
430
@@ -449,8 +446,8 @@ test('results with watching enabled', function (t) {
449
446
450
447
var actualOutput = reporter . finish ( { } ) ;
451
448
var expectedOutput = [
452
- '\n ' + chalk . green ( '1 passed' ) + time ,
453
- ''
449
+ '\n ' + chalk . green ( '1 passed' ) + time ,
450
+ '\n '
454
451
] . join ( '\n' ) ;
455
452
456
453
t . is ( actualOutput , expectedOutput ) ;
@@ -487,8 +484,8 @@ test('silently handles errors without body', function (t) {
487
484
} ;
488
485
var actualOutput = reporter . finish ( runStatus ) ;
489
486
var expectedOutput = [
490
- '\n ' + colors . error ( '1 failed' ) ,
491
- ''
487
+ '\n ' + colors . error ( '1 failed' ) ,
488
+ '\n '
492
489
] . join ( '\n' ) ;
493
490
t . is ( actualOutput , expectedOutput ) ;
494
491
t . end ( ) ;
@@ -504,8 +501,8 @@ test('does not handle errors with body in rejections', function (t) {
504
501
} ;
505
502
var actualOutput = reporter . finish ( runStatus ) ;
506
503
var expectedOutput = [
507
- '\n ' + colors . error ( '1 rejection' ) ,
508
- ''
504
+ '\n ' + colors . error ( '1 rejection' ) ,
505
+ '\n '
509
506
] . join ( '\n' ) ;
510
507
t . is ( actualOutput , expectedOutput ) ;
511
508
t . end ( ) ;
@@ -522,9 +519,10 @@ test('returns description based on error itself if no stack available', function
522
519
} ;
523
520
var actualOutput = reporter . finish ( runStatus ) ;
524
521
var expectedOutput = [
525
- '\n ' + colors . error ( '1 exception' ) ,
526
- '\n\n ' + colors . error ( '1. Uncaught Exception' ) ,
527
- ' ' + colors . stack ( JSON . stringify ( { error : err1 } ) ) + '\n'
522
+ '\n ' + colors . error ( '1 exception' ) ,
523
+ '\n ' + colors . title ( 'Uncaught Exception' ) ,
524
+ ' ' + colors . stack ( JSON . stringify ( { error : err1 } ) ) ,
525
+ '\n\n'
528
526
] . join ( '\n' ) ;
529
527
t . is ( actualOutput , expectedOutput ) ;
530
528
t . end ( ) ;
0 commit comments