File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed
Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ function Results () {
2424 this . _stream = through ( ) ;
2525 this . tests = [ ] ;
2626 this . _only = null ;
27+ this . _isRunning = false ;
2728}
2829
2930Results . prototype . createStream = function ( opts ) {
@@ -65,14 +66,17 @@ Results.prototype.createStream = function (opts) {
6566 self . _stream . pipe ( output ) ;
6667 }
6768
68- nextTick ( function next ( ) {
69- var t ;
70- while ( t = getNextTest ( self ) ) {
71- t . run ( ) ;
72- if ( ! t . ended ) return t . once ( 'end' , function ( ) { nextTick ( next ) ; } ) ;
73- }
74- self . emit ( 'done' ) ;
75- } ) ;
69+ if ( ! this . _isRunning ) {
70+ this . _isRunning = true ;
71+ nextTick ( function next ( ) {
72+ var t ;
73+ while ( t = getNextTest ( self ) ) {
74+ t . run ( ) ;
75+ if ( ! t . ended ) return t . once ( 'end' , function ( ) { nextTick ( next ) ; } ) ;
76+ }
77+ self . emit ( 'done' ) ;
78+ } ) ;
79+ }
7680
7781 return output ;
7882} ;
You can’t perform that action at this time.
0 commit comments