@@ -169,23 +169,23 @@ Test.prototype._end = function (err) {
169
169
this . exit ( ) ;
170
170
} ;
171
171
172
- Test . prototype . exit = function ( ) {
173
- var self = this ;
174
-
175
- function checkAssertLength ( ) {
176
- if ( self . assertError === undefined && self . planCount !== null && self . planCount !== self . assertions . length ) {
177
- self . _setAssertError ( new assert . AssertionError ( {
178
- actual : self . assertions . length ,
179
- expected : self . planCount ,
180
- message : 'Assertion count does not match planned' ,
181
- operator : 'plan'
182
- } ) ) ;
172
+ Test . prototype . _checkPlanCount = function ( ) {
173
+ if ( this . assertError === undefined && this . planCount !== null && this . planCount !== this . assertions . length ) {
174
+ this . _setAssertError ( new assert . AssertionError ( {
175
+ actual : this . assertions . length ,
176
+ expected : this . planCount ,
177
+ message : 'Assertion count does not match planned' ,
178
+ operator : 'plan'
179
+ } ) ) ;
183
180
184
- self . assertError . stack = self . planStack ;
185
- }
181
+ this . assertError . stack = this . planStack ;
186
182
}
183
+ } ;
184
+
185
+ Test . prototype . exit = function ( ) {
186
+ var self = this ;
187
187
188
- checkAssertLength ( ) ;
188
+ this . _checkPlanCount ( ) ;
189
189
190
190
Promise . all ( this . assertions )
191
191
. catch ( function ( err ) {
@@ -198,7 +198,7 @@ Test.prototype.exit = function () {
198
198
// stop infinite timer
199
199
globals . clearTimeout ( self . _timeout ) ;
200
200
201
- checkAssertLength ( ) ;
201
+ self . _checkPlanCount ( ) ;
202
202
203
203
if ( ! self . ended ) {
204
204
self . ended = true ;
0 commit comments