66
77import type { Task , TaskResultPack } from '@vitest/runner'
88import { getNames , getTests } from '@vitest/runner/utils'
9- import { performance } from 'node:perf_hooks'
109import colors , { type Colors } from 'tinyrainbow'
11- import type { RunnerTask , Vitest } from 'vitest'
10+ import type { RunnerTask , RunnerTestFile } from 'vitest'
1211import { DefaultReporter , type Reporter } from 'vitest/reporters'
1312
1413/**
@@ -34,7 +33,8 @@ class VerboseReporter extends DefaultReporter implements Reporter {
3433 * Create a new verbose reporter.
3534 */
3635 constructor ( ) {
37- super ( { summary : false } )
36+ super ( { summary : true } )
37+
3838 this . colors = colors
3939 this . renderSucceed = true
4040 this . verbose = true
@@ -98,33 +98,26 @@ class VerboseReporter extends DefaultReporter implements Reporter {
9898 }
9999
100100 /**
101- * Capture end time once all tests have finished running.
102- *
103- * @public
104- * @override
105- * @instance
106- *
107- * @return {undefined }
108- */
109- public override onFinished ( ) : undefined {
110- return void ( this . end = performance . now ( ) )
111- }
112-
113- /**
114- * Initialize the reporter.
101+ * Print tasks.
115102 *
116- * @see {@linkcode Vitest }
103+ * @see {@linkcode RunnerTestFile }
117104 *
118105 * @public
119106 * @override
120107 * @instance
121108 *
122- * @param {Vitest } ctx
123- * Vitest context
109+ * @param {RunnerTestFile[] | undefined } [files]
110+ * List of test files
111+ * @param {unknown[] | undefined } [errors]
112+ * List of unhandled errors
124113 * @return {undefined }
125114 */
126- public override onInit ( ctx : Vitest ) : undefined {
127- return void ( this . ctx = ctx , this . start = performance . now ( ) )
115+ public override onFinished (
116+ files ?: RunnerTestFile [ ] | undefined ,
117+ errors ?: unknown [ ] | undefined
118+ ) : undefined {
119+ if ( files ) { for ( const task of files ) this . printTask ( task , true ) }
120+ return void super . onFinished ( files , errors )
128121 }
129122
130123 /**
0 commit comments