Skip to content

Commit

Permalink
chore: change child_process title
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Sep 27, 2023
1 parent be64cc8 commit fc6330b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/vitest/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,10 @@ function normalizeCliOptions(argv: CliOptions): CliOptions {
}

async function start(mode: VitestRunMode, cliFilters: string[], options: CliOptions): Promise<Vitest | undefined> {
process.title = 'node (vitest)'
try {
process.title = 'node (vitest)'
}
catch {}

try {
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options))
Expand Down
5 changes: 5 additions & 0 deletions packages/vitest/src/runtime/child.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<CancelReason>((resolve) => {
setCancel = resolve
Expand Down

0 comments on commit fc6330b

Please sign in to comment.