File tree 4 files changed +31
-16
lines changed
4 files changed +31
-16
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,8 @@ if (args.length > 0) {
83
83
options . verbose ? _reporter . print ( '\n' ) : _reporter . print ( ' ' ) ;
84
84
}
85
85
} ;
86
+ reporter . reset = function ( ) { _reporter . reset && _reporter . reset ( ) } ;
87
+
86
88
suites = args . map ( function ( a ) {
87
89
a = path . join ( process . cwd ( ) , a . replace ( / \. j s $ / , '' ) ) ;
88
90
msg ( 'runner' , "loading" , a ) ;
@@ -257,6 +259,8 @@ function runSuites(suites, callback) {
257
259
total : 0 ,
258
260
time : 0
259
261
} ;
262
+ reporter . reset ( ) ;
263
+
260
264
( function run ( suites , callback ) {
261
265
var suite = suites . shift ( ) ;
262
266
if ( suite ) {
Original file line number Diff line number Diff line change @@ -110,20 +110,16 @@ function addVow(vow) {
110
110
}
111
111
112
112
function output ( status , exception ) {
113
- var context ;
114
-
115
- if ( exception ) {
116
- if ( vow . context && batch . lastContext !== vow . context ) {
117
- batch . lastContext = context = vow . context ;
118
- batch . suite . report ( [ 'context' , context ] ) ;
119
- }
120
- batch . suite . report ( [ 'vow' , {
121
- title : vow . description ,
122
- context : context ,
123
- status : status ,
124
- exception : exception || null
125
- } ] ) ;
113
+ if ( vow . context && batch . lastContext !== vow . context ) {
114
+ batch . lastContext = vow . context ;
115
+ batch . suite . report ( [ 'context' , vow . context ] ) ;
126
116
}
117
+ batch . suite . report ( [ 'vow' , {
118
+ title : vow . description ,
119
+ context : vow . context ,
120
+ status : status ,
121
+ exception : exception || null
122
+ } ] ) ;
127
123
}
128
124
} ;
129
125
Original file line number Diff line number Diff line change @@ -8,9 +8,13 @@ var stylize = console.stylize,
8
8
//
9
9
// Console reporter
10
10
//
11
- var stream , messages = [ ] ;
11
+ var stream , messages = [ ] , lastContext ;
12
12
13
13
this . name = 'dot-matrix' ;
14
+ this . reset = function ( ) {
15
+ messages = [ ] ;
16
+ lastContext = null ;
17
+ } ;
14
18
this . report = function ( data , s ) {
15
19
var event = data [ 1 ] ;
16
20
@@ -28,7 +32,10 @@ this.report = function (data, s) {
28
32
} else if ( event . status === 'pending' ) {
29
33
sys . print ( stylize ( '.' , 'cyan' ) ) ;
30
34
} else {
31
- event . context && messages . push ( event . context ) ;
35
+ if ( lastContext !== event . context ) {
36
+ lastContext = event . context ;
37
+ messages . push ( event . context ) ;
38
+ }
32
39
if ( event . status === 'broken' ) {
33
40
sys . print ( stylize ( 'B' , 'yellow' ) ) ;
34
41
messages . push ( ' - ' + stylize ( event . title , 'yellow' ) ) ;
Original file line number Diff line number Diff line change @@ -7,7 +7,12 @@ var stylize = console.stylize,
7
7
//
8
8
// Console reporter
9
9
//
10
+ var lastContext ;
11
+
10
12
this . name = 'watch' ;
13
+ this . reset = function ( ) {
14
+ lastContext = null ;
15
+ } ;
11
16
this . report = function ( data ) {
12
17
var event = data [ 1 ] ;
13
18
@@ -16,7 +21,10 @@ this.report = function (data) {
16
21
switch ( data [ 0 ] ) {
17
22
case 'vow' :
18
23
if ( event . status !== 'honored' ) {
19
- event . context && puts ( event . context ) ;
24
+ if ( lastContext !== event . context ) {
25
+ lastContext = event . context ;
26
+ puts ( event . context ) ;
27
+ }
20
28
if ( event . status === 'broken' ) {
21
29
puts ( ' - ' + stylize ( event . title , 'yellow' ) ) ;
22
30
puts ( ' ~ ' + event . exception ) ;
You can’t perform that action at this time.
0 commit comments