File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -16,8 +16,9 @@ module.exports = function (test) {
16
16
17
17
nextTick ( function next ( ) {
18
18
var t = results . tests . shift ( ) ;
19
+ if ( ! t && results . subtests ) return ;
19
20
if ( ! t ) return results . close ( ) ;
20
- t . on ( 'end' , function ( ) { nextTick ( next ) } ) ;
21
+ t . on ( 'end' , next ) ;
21
22
t . run ( ) ;
22
23
} ) ;
23
24
@@ -30,6 +31,7 @@ function Results (stream) {
30
31
this . pass = 0 ;
31
32
this . stream = stream ;
32
33
this . tests = [ ] ;
34
+ this . subtests = 0 ;
33
35
}
34
36
35
37
Results . prototype . push = function ( t , parentT ) {
@@ -50,8 +52,10 @@ Results.prototype.push = function (t, parentT) {
50
52
var subtests = 0 ;
51
53
t . on ( 'test' , function ( st ) {
52
54
subtests ++ ;
55
+ self . subtests ++ ;
53
56
st . on ( 'end' , function ( ) {
54
57
subtests -- ;
58
+ self . subtests -- ;
55
59
if ( subtests === 0 && ! plan ) t . emit ( 'end' ) ;
56
60
nextTick ( function ( ) { onend . call ( t ) } ) ;
57
61
} ) ;
You can’t perform that action at this time.
0 commit comments