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

Method onBeforeRunSuite

packages/vitest/src/runtime/runners/test.ts:154–168  ·  view source on GitHub ↗
(suite: Suite)

Source from the content-addressed store, hash-verified

152 }
153
154 async onBeforeRunSuite(suite: Suite): Promise<void> {
155 if (this.cancelRun) {
156 suite.mode = 'skip'
157 }
158
159 // initialize snapshot state before running file suite
160 if (suite.mode !== 'skip' && 'filepath' in suite) {
161 await this.snapshotClient.setup(
162 suite.file.filepath,
163 this.workerState.config.snapshotOptions,
164 )
165 }
166
167 this.workerState.current = suite
168 }
169
170 onBeforeTryTask(test: Task): void {
171 clearModuleMocks(this.config)

Callers 2

BrowserTestRunnerClass · 0.80
runSuiteFunction · 0.80

Calls 1

setupMethod · 0.80

Tested by

no test coverage detected