mirror of
https://github.com/hanzoai/vitest.git
synced 2026-10-30 14:46:34 +00:00
23 lines
455 B
TypeScript
23 lines
455 B
TypeScript
import type { Reporter, Vitest } from 'vitest/node'
|
|
|
|
export default class TestReporter implements Reporter {
|
|
ctx!: Vitest
|
|
options?: unknown
|
|
|
|
constructor(options?: unknown) {
|
|
this.options = options
|
|
}
|
|
|
|
onInit(ctx: Vitest) {
|
|
this.ctx = ctx
|
|
}
|
|
|
|
onTestRunEnd() {
|
|
this.ctx.logger.log('hello from custom reporter')
|
|
|
|
if (this.options) {
|
|
this.ctx.logger.log(`custom reporter options ${JSON.stringify(this.options)}`)
|
|
}
|
|
}
|
|
}
|