MCPcopy
hub / github.com/vitest-dev/vitest / onInit

Method onInit

packages/vitest/src/node/reporters/summary.ts:68–85  ·  view source on GitHub ↗
(ctx: Vitest, options: Options = {})

Source from the content-addressed store, hash-verified

66 private durationInterval: NodeJS.Timeout | undefined = undefined
67
68 onInit(ctx: Vitest, options: Options = {}): void {
69 this.ctx = ctx
70
71 this.options = {
72 verbose: false,
73 ...options,
74 }
75
76 this.renderer = new WindowRenderer({
77 logger: ctx.logger,
78 getWindow: () => this.createSummary(),
79 })
80
81 this.ctx.onClose(() => {
82 clearInterval(this.durationInterval)
83 this.renderer.stop()
84 })
85 }
86
87 onTestRunStart(specifications: ReadonlyArray<TestSpecification>): void {
88 this.runningModules.clear()

Callers

nothing calls this directly

Calls 3

createSummaryMethod · 0.95
onCloseMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected