File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -100,11 +100,14 @@ Test.prototype._exit = function () {
100100 this . _planError = true ;
101101 this . fail ( 'plan != count' , {
102102 expected : this . _plan ,
103- actual : this . assertCount
103+ actual : this . assertCount ,
104+ exiting : true
104105 } ) ;
105106 }
106107 else if ( ! this . ended ) {
107- this . fail ( 'test exited without ending' ) ;
108+ this . fail ( 'test exited without ending' , {
109+ exiting : true
110+ } ) ;
108111 }
109112} ;
110113
@@ -152,7 +155,10 @@ Test.prototype._assert = function assert (ok, opts) {
152155
153156 self . emit ( 'result' , res ) ;
154157
155- if ( self . _plan === self . assertCount ) {
158+ if ( self . _plan === self . assertCount && extra . exiting ) {
159+ if ( ! self . ended ) self . end ( ) ;
160+ }
161+ else if ( self . _plan === self . assertCount ) {
156162 nextTick ( function ( ) {
157163 if ( ! self . ended ) self . end ( ) ;
158164 } ) ;
You can’t perform that action at this time.
0 commit comments