diff --git a/packages/vitest/src/runtime/child.ts b/packages/vitest/src/runtime/child.ts index 70e1c1ed312b..1311a20ae284 100644 --- a/packages/vitest/src/runtime/child.ts +++ b/packages/vitest/src/runtime/child.ts @@ -13,17 +13,17 @@ import { mockMap, moduleCache, startViteNode } from './execute' import { createSafeRpc, rpcDone } from './rpc' import { setupInspect } from './inspector' +try { + process.title = `node (vitest ${poolId})` +} +catch {} + async function init(ctx: ChildContext) { const { config, workerId, providedContext } = ctx process.env.VITEST_WORKER_ID = String(workerId) process.env.VITEST_POOL_ID = String(poolId) - try { - process.title = `node (vitest ${poolId})` - } - catch {} - let setCancel = (_reason: CancelReason) => {} const onCancel = new Promise((resolve) => { setCancel = resolve