File tree 2 files changed +19
-2
lines changed
2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,7 @@ function createHarness () {
17
17
conf = { } ;
18
18
}
19
19
var t = new Test ;
20
- out . push ( t ) ;
21
-
20
+ t . name = name ;
22
21
var piped = false ;
23
22
24
23
t . pipe = function ( ) {
@@ -35,6 +34,7 @@ function createHarness () {
35
34
36
35
var run = function ( ) {
37
36
running = true ;
37
+ out . push ( t ) ;
38
38
cb ( t ) ;
39
39
} ;
40
40
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ function Render () {
6
6
Stream . call ( this ) ;
7
7
this . readable = true ;
8
8
this . count = 0 ;
9
+ this . fail = 0 ;
10
+ this . pass = 0 ;
9
11
}
10
12
11
13
Render . prototype = new Stream ;
@@ -16,13 +18,28 @@ Render.prototype.begin = function () {
16
18
17
19
Render . prototype . push = function ( t ) {
18
20
var self = this ;
21
+ this . emit ( 'data' , '# ' + t . name + '\n' ) ;
22
+
19
23
t . on ( 'result' , function ( res ) {
20
24
self . emit ( 'data' , encodeResult ( res , self . count + 1 ) ) ;
21
25
self . count ++ ;
26
+
27
+ if ( res . ok ) self . pass ++
28
+ else self . fail ++
22
29
} ) ;
23
30
} ;
24
31
25
32
Render . prototype . close = function ( ) {
33
+ this . emit ( 'data' , '\n1..' + this . count + '\n' ) ;
34
+ this . emit ( 'data' , '# tests ' + this . count + '\n' ) ;
35
+ this . emit ( 'data' , '# pass ' + this . pass + '\n' ) ;
36
+ if ( this . fail ) {
37
+ this . emit ( 'data' , '# fail ' + this . fail + '\n' ) ;
38
+ }
39
+ else {
40
+ this . emit ( 'data' , '\n# ok\n' ) ;
41
+ }
42
+
26
43
this . emit ( 'end' ) ;
27
44
} ;
28
45
You can’t perform that action at this time.
0 commit comments