@@ -2,6 +2,7 @@ import type { File, Task, TestAnnotation } from '@vitest/runner'
22import type { SerializedError } from '@vitest/utils'
33import type { TestError , UserConsoleLog } from '../../types/general'
44import type { Vitest } from '../core'
5+ import type { TestSpecification } from '../spec'
56import type { Reporter , TestRunEndReason } from '../types/reporter'
67import type { TestCase , TestCollection , TestModule , TestModuleState , TestResult , TestSuite , TestSuiteState } from './reported-tasks'
78import { performance } from 'node:perf_hooks'
@@ -57,7 +58,6 @@ export abstract class BaseReporter implements Reporter {
5758 this . ctx = ctx
5859
5960 this . ctx . logger . printBanner ( )
60- this . start = performance . now ( )
6161 }
6262
6363 log ( ...messages : any ) : void {
@@ -72,6 +72,11 @@ export abstract class BaseReporter implements Reporter {
7272 return relative ( this . ctx . config . root , path )
7373 }
7474
75+ onTestRunStart ( _specifications : ReadonlyArray < TestSpecification > ) : void {
76+ this . start = performance . now ( )
77+ this . _timeStart = formatTimeString ( new Date ( ) )
78+ }
79+
7580 onTestRunEnd (
7681 testModules : ReadonlyArray < TestModule > ,
7782 unhandledErrors : ReadonlyArray < SerializedError > ,
@@ -419,9 +424,6 @@ export abstract class BaseReporter implements Reporter {
419424 for ( const testModule of this . failedUnwatchedFiles ) {
420425 this . printTestModule ( testModule )
421426 }
422-
423- this . _timeStart = formatTimeString ( new Date ( ) )
424- this . start = performance . now ( )
425427 }
426428
427429 onUserConsoleLog ( log : UserConsoleLog , taskState ?: TestResult [ 'state' ] ) : void {
0 commit comments