From fc6330b8e9dba5f11435e17867439f55d0aeda62 Mon Sep 17 00:00:00 2001 From: Vladimir Sheremet Date: Wed, 27 Sep 2023 19:32:42 +0200 Subject: [PATCH] chore: change child_process title --- packages/vitest/src/node/cli.ts | 5 ++++- packages/vitest/src/runtime/child.ts | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/vitest/src/node/cli.ts b/packages/vitest/src/node/cli.ts index 758f93b5989f..c12088fe9e85 100644 --- a/packages/vitest/src/node/cli.ts +++ b/packages/vitest/src/node/cli.ts @@ -167,7 +167,10 @@ function normalizeCliOptions(argv: CliOptions): CliOptions { } async function start(mode: VitestRunMode, cliFilters: string[], options: CliOptions): Promise { - process.title = 'node (vitest)' + try { + process.title = 'node (vitest)' + } + catch {} try { const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options)) diff --git a/packages/vitest/src/runtime/child.ts b/packages/vitest/src/runtime/child.ts index b1b1d915b4f4..446ad4ac5d97 100644 --- a/packages/vitest/src/runtime/child.ts +++ b/packages/vitest/src/runtime/child.ts @@ -19,6 +19,11 @@ async function init(ctx: ChildContext) { 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