@@ -218,6 +218,7 @@ export abstract class BaseReporter implements Reporter {
218
218
const collectTime = files . reduce ( ( acc , test ) => acc + Math . max ( 0 , test . collectDuration || 0 ) , 0 )
219
219
const setupTime = files . reduce ( ( acc , test ) => acc + Math . max ( 0 , test . setupDuration || 0 ) , 0 )
220
220
const testsTime = files . reduce ( ( acc , test ) => acc + Math . max ( 0 , test . result ?. duration || 0 ) , 0 )
221
+ const transformTime = Array . from ( this . ctx . vitenode . fetchCache . values ( ) ) . reduce ( ( a , b ) => a + ( b ?. duration || 0 ) , 0 )
221
222
const threadTime = collectTime + testsTime + setupTime
222
223
223
224
const padTitle = ( str : string ) => c . dim ( `${ str . padStart ( 10 ) } ` )
@@ -227,6 +228,14 @@ export abstract class BaseReporter implements Reporter {
227
228
return `${ Math . round ( time ) } ms`
228
229
}
229
230
231
+ // show top 10 costly transform module
232
+ // console.log(Array.from(this.ctx.vitenode.fetchCache.entries()).filter(i => i[1].duration)
233
+ // .sort((a, b) => b[1].duration! - a[1].duration!)
234
+ // .map(i => `${time(i[1].duration!)} ${i[0]}`)
235
+ // .slice(0, 10)
236
+ // .join('\n'),
237
+ // )
238
+
230
239
const snapshotOutput = renderSnapshotSummary ( this . ctx . config . root , this . ctx . snapshot . summary )
231
240
if ( snapshotOutput . length ) {
232
241
logger . log ( snapshotOutput . map ( ( t , i ) => i === 0
@@ -243,7 +252,7 @@ export abstract class BaseReporter implements Reporter {
243
252
if ( this . watchFilters )
244
253
logger . log ( padTitle ( 'Duration' ) , time ( threadTime ) )
245
254
else
246
- logger . log ( padTitle ( 'Duration' ) , time ( executionTime ) + c . gray ( ` (setup ${ time ( setupTime ) } , collect ${ time ( collectTime ) } , tests ${ time ( testsTime ) } )` ) )
255
+ logger . log ( padTitle ( 'Duration' ) , time ( executionTime ) + c . dim ( ` (transform ${ time ( transformTime ) } , setup ${ time ( setupTime ) } , collect ${ time ( collectTime ) } , tests ${ time ( testsTime ) } )` ) )
247
256
248
257
logger . log ( )
249
258
}
0 commit comments