@@ -15,6 +15,8 @@ function Formatter(opts) {
15
15
Formatter . prototype . init = function ( reporter ) {
16
16
var self = this
17
17
18
+ reporter . push ( LF + this . splitter ( ' Tests ' ) )
19
+
18
20
reporter . on ( 'test.start' , function ( test ) {
19
21
Object . defineProperty ( test , 'title' , { get : getTitle } )
20
22
} )
@@ -46,20 +48,27 @@ Formatter.prototype.summary = function (summary) {
46
48
output . push ( this . splitter ( ' Summary ' ) )
47
49
48
50
if ( this . needDuration ) {
49
- output . push (
50
- this . format ( 'duration: ' + prettyMs ( summary . duration ) , 'cyan' )
51
- )
51
+ output . push ( this . format (
52
+ 'duration: ' + prettyMs ( summary . duration ) ,
53
+ 'cyan'
54
+ ) )
52
55
}
53
- output . push (
54
- this . format ( 'planned: ' + summary . planned , summary . planned > 0 ? 'cyan' : 'red' )
55
- )
56
- output . push ( this . format ( 'assertions: ' + summary . assertions , 'cyan' ) )
57
- output . push (
58
- this . format ( 'pass: ' + summary . pass , summary . pass ? 'green' : 'cyan' )
59
- )
60
- output . push (
61
- this . format ( 'fail: ' + summary . fail , summary . fail ? 'red' : 'cyan' )
62
- )
56
+ output . push ( this . format (
57
+ 'planned: ' + summary . planned ,
58
+ summary . planned instanceof Error ? 'red' : 'cyan'
59
+ ) )
60
+ output . push ( this . format (
61
+ 'assertions: ' + summary . assertions ,
62
+ 'cyan'
63
+ ) )
64
+ output . push ( this . format (
65
+ 'pass: ' + summary . pass ,
66
+ summary . pass ? 'green' : 'cyan'
67
+ ) )
68
+ output . push ( this . format (
69
+ 'fail: ' + summary . fail ,
70
+ summary . fail ? 'red' : 'cyan'
71
+ ) )
63
72
64
73
return output . join ( LF )
65
74
}
@@ -114,9 +123,6 @@ Formatter.prototype.splitter = function (s) {
114
123
}
115
124
116
125
Formatter . prototype . test = function ( test ) {
117
- if ( ! test ) {
118
- return LF + this . splitter ( ' Tests ' )
119
- }
120
126
if ( this . needProgress ) {
121
127
if ( test . fail ) {
122
128
return this . format ( symbols . cross + ' ' + test . title , 'cha.red.eraseLine' )
0 commit comments