File tree 1 file changed +24
-9
lines changed
1 file changed +24
-9
lines changed Original file line number Diff line number Diff line change 1
1
var events = require ( 'events' ) ,
2
2
path = require ( 'path' ) ;
3
3
4
- var vows = require ( path . join ( __dirname , '..' , 'vows' ) ) ;
4
+ require . paths . unshift ( path . join ( __dirname , '..' ) ) ;
5
+
6
+ var vows = require ( 'vows' ) ;
5
7
var Context = require ( 'vows/context' ) . Context ;
6
8
var tryEnd = vows . tryEnd ;
7
9
8
- this . Suite = function ( ) {
9
- this . results = {
10
- honored : 0 ,
11
- broken : 0 ,
12
- errored : 0 ,
13
- total : 0 ,
14
- time : null
15
- } ;
10
+ this . Suite = function ( subject ) {
11
+ this . subject = subject ;
16
12
this . batches = [ ] ;
13
+ this . reset ( ) ;
17
14
} ;
18
15
19
16
this . Suite . prototype = new ( function ( ) {
17
+ this . reset = function ( ) {
18
+ this . results = {
19
+ honored : 0 ,
20
+ broken : 0 ,
21
+ errored : 0 ,
22
+ total : 0 ,
23
+ time : null
24
+ } ;
25
+ this . batches . forEach ( function ( b ) {
26
+ b . lastContext = null ;
27
+ b . remaining = b . _remaining ;
28
+ b . honored = b . broken = b . errored = b . total = 0 ;
29
+ } ) ;
30
+ } ;
31
+
20
32
this . addVows = function ( tests ) {
21
33
var batch = {
22
34
tests : tests ,
23
35
suite : this ,
24
36
remaining : 0 ,
37
+ _remaining : 0 ,
25
38
honored : 0 ,
26
39
broken : 0 ,
27
40
errored : 0 ,
@@ -55,6 +68,7 @@ this.Suite.prototype = new(function () {
55
68
return match ;
56
69
} ) ( tests ) ;
57
70
}
71
+ batch . _remaining = batch . remaining ;
58
72
59
73
return this ;
60
74
} ;
@@ -189,6 +203,7 @@ this.Suite.prototype = new(function () {
189
203
process . stdout . addListener ( 'drain' , function ( ) {
190
204
process . exit ( that . results . broken || that . results . errored ? 1 : 0 ) ;
191
205
} ) ;
206
+ that . reset ( ) ;
192
207
}
193
208
} ) ( this . batches . slice ( 0 ) ) ;
194
209
} ;
You can’t perform that action at this time.
0 commit comments