File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -120,12 +120,13 @@ export async function runTests(context: Rstest): Promise<void> {
120120 const run = async ( {
121121 fileFilters,
122122 mode = 'all' ,
123+ buildStart = Date . now ( ) ,
123124 } : {
124125 fileFilters ?: string [ ] ;
125126 mode ?: Mode ;
127+ buildStart ?: number ;
126128 } = { } ) => {
127129 let testStart : number ;
128- const buildStart = Date . now ( ) ;
129130 const currentEntries : EntryInfo [ ] = [ ] ;
130131 const currentDeletedEntries : string [ ] = [ ] ;
131132
@@ -314,15 +315,19 @@ export async function runTests(context: Rstest): Promise<void> {
314315 await closeServer ( ) ;
315316 } ) ;
316317
318+ let buildStart : number | undefined ;
319+
317320 rsbuildInstance . onBeforeDevCompile ( ( { isFirstCompile } ) => {
321+ buildStart = Date . now ( ) ;
318322 if ( ! isFirstCompile ) {
319323 clearScreen ( ) ;
320324 }
321325 } ) ;
322326
323327 rsbuildInstance . onAfterDevCompile ( async ( { isFirstCompile } ) => {
324328 snapshotManager . clear ( ) ;
325- await run ( { mode : isFirstCompile ? 'all' : 'on-demand' } ) ;
329+ await run ( { buildStart, mode : isFirstCompile ? 'all' : 'on-demand' } ) ;
330+ buildStart = undefined ;
326331
327332 if ( isFirstCompile && enableCliShortcuts ) {
328333 const closeCliShortcuts = await setupCliShortcuts ( {
You can’t perform that action at this time.
0 commit comments