@@ -134,6 +134,7 @@ export abstract class BaseReporter implements Reporter {
134134 let testsCount = 0
135135 let failedCount = 0
136136 let skippedCount = 0
137+ let todoCount = 0
137138
138139 // delaying logs to calculate the test stats first
139140 // which minimizes the amount of for loops
@@ -147,7 +148,7 @@ export abstract class BaseReporter implements Reporter {
147148 const suiteState = child . state ( )
148149
149150 // Skipped suites are hidden when --hideSkippedTests, print otherwise
150- if ( ! this . ctx . config . hideSkippedTests || suiteState !== 'skipped' ) {
151+ if ( ! this . ctx . config . hideSkippedTests || suiteState !== 'skipped' || child . task . mode === 'todo' ) {
151152 this . printTestSuite ( child )
152153 }
153154
@@ -161,10 +162,15 @@ export abstract class BaseReporter implements Reporter {
161162 failedCount ++
162163 }
163164 else if ( testResult . state === 'skipped' ) {
164- skippedCount ++
165+ if ( child . options . mode === 'todo' ) {
166+ todoCount ++
167+ }
168+ else {
169+ skippedCount ++
170+ }
165171 }
166172
167- if ( this . ctx . config . hideSkippedTests && suiteState === 'skipped' ) {
173+ if ( this . ctx . config . hideSkippedTests && suiteState === 'skipped' && child . options . mode !== 'todo' ) {
168174 // Skipped suites are hidden when --hideSkippedTests
169175 continue
170176 }
@@ -185,6 +191,7 @@ export abstract class BaseReporter implements Reporter {
185191 tests : testsCount ,
186192 failed : failedCount ,
187193 skipped : skippedCount ,
194+ todo : todoCount ,
188195 } ) )
189196 logs . forEach ( log => this . log ( log ) )
190197 }
@@ -205,7 +212,7 @@ export abstract class BaseReporter implements Reporter {
205212 this . log ( ` ${ padding } ${ c . yellow ( c . dim ( F_CHECK ) ) } ${ this . getTestName ( test . task , separator ) } ${ suffix } ` )
206213 }
207214
208- else if ( this . ctx . config . hideSkippedTests && ( testResult . state === 'skipped' ) ) {
215+ else if ( this . ctx . config . hideSkippedTests && testResult . state === 'skipped' && test . options . mode !== 'todo' ) {
209216 // Skipped tests are hidden when --hideSkippedTests
210217 }
211218
@@ -218,6 +225,7 @@ export abstract class BaseReporter implements Reporter {
218225 tests : number
219226 failed : number
220227 skipped : number
228+ todo : number
221229 } ) : string {
222230 let state = c . dim ( `${ counts . tests } test${ counts . tests > 1 ? 's' : '' } ` )
223231
@@ -229,6 +237,10 @@ export abstract class BaseReporter implements Reporter {
229237 state += c . dim ( ' | ' ) + c . yellow ( `${ counts . skipped } skipped` )
230238 }
231239
240+ if ( counts . todo ) {
241+ state += c . dim ( ' | ' ) + c . gray ( `${ counts . todo } todo` )
242+ }
243+
232244 let suffix = c . dim ( '(' ) + state + c . dim ( ')' ) + this . getDurationPrefix ( testModule . task )
233245
234246 const diagnostic = testModule . diagnostic ( )
0 commit comments