@@ -185,23 +185,20 @@ export class Printer {
185185 }
186186
187187 testResultSummary ( result : TestResultSummary ) {
188- const hasFailures = ( result . errors ?? 0 ) > 0 || ( result . failures ?? 0 ) > 0 ;
188+ const hasFailures = ( result . failed ?? result . failures ?? result . errors ?? 0 ) > 0 ;
189189 const countColor = hasFailures
190190 ? this . style . failed . bind ( this . style )
191191 : this . style . passed . bind ( this . style ) ;
192192
193193 const parts : string [ ] = [ ] ;
194- const failedCount = ( result . errors ?? 0 ) + ( result . failures ?? 0 ) + ( result . warnings ?? 0 ) ;
195- if ( failedCount > 0 ) {
196- parts . push ( this . style . failed ( `${ failedCount } failed` ) ) ;
194+ if ( ( result . failed ?? 0 ) > 0 ) {
195+ parts . push ( this . style . failed ( `${ result . failed } failed` ) ) ;
197196 }
198197 if ( ( result . skipped ?? 0 ) > 0 ) {
199198 parts . push ( this . style . ignored ( `${ result . skipped } skipped` ) ) ;
200199 }
201- const passedCount =
202- ( result . tests ?? 0 ) - failedCount - ( result . skipped ?? 0 ) - ( result . incomplete ?? 0 ) ;
203- if ( passedCount > 0 ) {
204- parts . push ( this . style . passed ( `${ passedCount } passed` ) ) ;
200+ if ( ( result . passed ?? 0 ) > 0 ) {
201+ parts . push ( this . style . passed ( `${ result . passed } passed` ) ) ;
205202 }
206203
207204 const summary =
@@ -218,6 +215,8 @@ export class Printer {
218215 'skipped' ,
219216 'incomplete' ,
220217 'risky' ,
218+ 'passed' ,
219+ 'failed' ,
221220 ] as const ;
222221 const vars : Record < string , string | undefined > = {
223222 text : result . text . trim ( ) ,
@@ -511,11 +510,13 @@ export class Printer {
511510 return undefined ;
512511 }
513512
513+ const maxIndexWidth = String ( result . details . length ) . length ;
514+
514515 return [
515516 '' ,
516517 ...result . details . map ( ( { file, line } , index ) =>
517518 this . interpolate ( this . format . error . detail . line , {
518- index : String ( index + 1 ) ,
519+ index : String ( index + 1 ) . padStart ( maxIndexWidth ) ,
519520 file : fileFormat ( file , line ) ,
520521 } ) ,
521522 ) ,
0 commit comments