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

Method onStop

packages/vitest/src/node/pools/poolRunner.ts:276–289  ·  view source on GitHub ↗
(response: WorkerResponse)

Source from the content-addressed store, hash-verified

274 await this.withTimeout(
275 new Promise<void>((resolve) => {
276 const onStop = (response: WorkerResponse) => {
277 if (response.type === 'stopped') {
278 if (response.error) {
279 stopSpan.recordException(response.error as Error)
280 this.project.vitest.state.catchError(
281 response.error,
282 'Teardown Error',
283 )
284 }
285
286 resolve()
287 this.off('message', onStop)
288 }
289 }
290
291 // Don't wait for graceful exit's response when force exiting
292 if (options?.force) {

Callers 2

stopMethod · 0.80
stopMethod · 0.80

Calls 3

offMethod · 0.95
catchErrorMethod · 0.80
resolveFunction · 0.70

Tested by

no test coverage detected