File tree 1 file changed +18
-10
lines changed 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,23 @@ Test.prototype._end = function (err) {
172
172
Test . prototype . exit = function ( ) {
173
173
var self = this ;
174
174
175
+ function checkAssertLength ( ) {
176
+ if ( self . assertError === undefined && self . planCount !== null && self . planCount !== self . assertPromises . length ) {
177
+ self . _setAssertError ( new assert . AssertionError ( {
178
+ actual : self . assertPromises . length ,
179
+ expected : self . planCount ,
180
+ message : 'Assertion count does not match planned' ,
181
+ operator : 'plan'
182
+ } ) ) ;
183
+
184
+ self . assertError . stack = self . planStack ;
185
+ return false ;
186
+ }
187
+ return true ;
188
+ }
189
+
190
+ checkAssertLength ( ) ;
191
+
175
192
Promise . all ( this . assertPromises )
176
193
. catch ( function ( err ) {
177
194
self . _setAssertError ( err ) ;
@@ -183,16 +200,7 @@ Test.prototype.exit = function () {
183
200
// stop infinite timer
184
201
globals . clearTimeout ( self . _timeout ) ;
185
202
186
- if ( self . assertError === undefined && self . planCount !== null && self . planCount !== self . assertPromises . length ) {
187
- self . _setAssertError ( new assert . AssertionError ( {
188
- actual : self . assertPromises . length ,
189
- expected : self . planCount ,
190
- message : 'Assertion count does not match planned' ,
191
- operator : 'plan'
192
- } ) ) ;
193
-
194
- self . assertError . stack = self . planStack ;
195
- }
203
+ checkAssertLength ( ) ;
196
204
197
205
if ( ! self . ended ) {
198
206
self . ended = true ;
You can’t perform that action at this time.
0 commit comments