[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix(reporters): report correct test run duration at the end (#8969)

authored by

Vladimir and committed by
GitHub
(Nov 17, 2025, 11:43 AM +0100) bc3a6921 4f2776e7

+7 -4
+6 -4
packages/vitest/src/node/reporters/base.ts
··· 2 2 import type { SerializedError } from '@vitest/utils' 3 3 import type { TestError, UserConsoleLog } from '../../types/general' 4 4 import type { Vitest } from '../core' 5 + import type { TestSpecification } from '../spec' 5 6 import type { Reporter, TestRunEndReason } from '../types/reporter' 6 7 import type { TestCase, TestCollection, TestModule, TestModuleState, TestResult, TestSuite, TestSuiteState } from './reported-tasks' 7 8 import { performance } from 'node:perf_hooks' ··· 57 58 this.ctx = ctx 58 59 59 60 this.ctx.logger.printBanner() 60 - this.start = performance.now() 61 61 } 62 62 63 63 log(...messages: any): void { ··· 70 70 71 71 relative(path: string): string { 72 72 return relative(this.ctx.config.root, path) 73 + } 74 + 75 + onTestRunStart(_specifications: ReadonlyArray<TestSpecification>): void { 76 + this.start = performance.now() 77 + this._timeStart = formatTimeString(new Date()) 73 78 } 74 79 75 80 onTestRunEnd( ··· 419 424 for (const testModule of this.failedUnwatchedFiles) { 420 425 this.printTestModule(testModule) 421 426 } 422 - 423 - this._timeStart = formatTimeString(new Date()) 424 - this.start = performance.now() 425 427 } 426 428 427 429 onUserConsoleLog(log: UserConsoleLog, taskState?: TestResult['state']): void {
+1
packages/vitest/src/node/reporters/default.ts
··· 42 42 } 43 43 } 44 44 45 + super.onTestRunStart(specifications) 45 46 this.summary?.onTestRunStart(specifications) 46 47 } 47 48