@@ -87,17 +87,17 @@ Runner.prototype._addFn = function (opts, title, fn) {
87
87
} ;
88
88
89
89
Runner . prototype . _runTestWithHooks = function ( test ) {
90
- if ( test . skip ) {
90
+ if ( test . metadata . skipped ) {
91
91
return this . _addTestResult ( test ) ;
92
92
}
93
93
94
94
function hookToTest ( hook ) {
95
95
return hook . test ( test . title ) ;
96
96
}
97
97
98
- var tests = this . select ( { type : 'beforeEach' , skipped : false } ) . map ( hookToTest ) ;
98
+ var tests = this . select ( { type : 'beforeEach' } ) . map ( hookToTest ) ;
99
99
tests . push ( test ) ;
100
- tests . push . apply ( tests , this . select ( { type : 'afterEach' , skipped : false } ) . map ( hookToTest ) ) ;
100
+ tests . push . apply ( tests , this . select ( { type : 'afterEach' } ) . map ( hookToTest ) ) ;
101
101
102
102
var context = { } ;
103
103
@@ -120,6 +120,10 @@ Runner.prototype._runTest = function (test) {
120
120
121
121
// add test result regardless of state
122
122
// but on error, don't execute next tests
123
+ if ( test . metadata . skipped ) {
124
+ return this . _addTestResult ( test ) ;
125
+ }
126
+
123
127
return test . run ( ) . finally ( function ( ) {
124
128
self . _addTestResult ( test ) ;
125
129
} ) ;
@@ -147,7 +151,7 @@ Runner.prototype._addTestResult = function (test) {
147
151
title : test . title ,
148
152
error : test . assertError ,
149
153
type : test . metadata . type ,
150
- skip : test . skip
154
+ skip : test . metadata . skipped
151
155
} ;
152
156
153
157
this . results . push ( props ) ;
@@ -165,25 +169,28 @@ Runner.prototype.run = function () {
165
169
166
170
var serial = this . select ( {
167
171
exclusive : hasExclusive ,
168
- skipped : false ,
169
172
serial : true ,
170
173
type : 'test'
171
174
} ) ;
172
175
173
176
var concurrent = this . select ( {
174
177
exclusive : hasExclusive ,
175
- skipped : false ,
176
178
serial : false ,
177
179
type : 'test'
178
180
} ) ;
179
181
182
+ var skipped = this . select ( {
183
+ type : 'test' ,
184
+ skipped : true
185
+ } ) ;
186
+
180
187
var stats = this . stats = {
181
188
failCount : 0 ,
182
189
passCount : 0 ,
183
- testCount : serial . length + concurrent . length
190
+ testCount : serial . length + concurrent . length - skipped . length
184
191
} ;
185
192
186
- return eachSeries ( this . select ( { type : 'before' , skipped : false } ) , this . _runTest , this )
193
+ return eachSeries ( this . select ( { type : 'before' } ) , this . _runTest , this )
187
194
. catch ( noop )
188
195
. then ( function ( ) {
189
196
if ( stats . failCount > 0 ) {
@@ -197,7 +204,7 @@ Runner.prototype.run = function () {
197
204
return self . _runConcurrent ( concurrent ) ;
198
205
} )
199
206
. then ( function ( ) {
200
- return eachSeries ( self . select ( { type : 'after' , skipped : false } ) , self . _runTest , self ) ;
207
+ return eachSeries ( self . select ( { type : 'after' } ) , self . _runTest , self ) ;
201
208
} )
202
209
. catch ( noop )
203
210
. then ( function ( ) {
0 commit comments