Skip to content

Commit

Permalink
feat: include "vitest" in the process name (vitest-dev#4191)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored and LorenzoBloedow committed Dec 19, 2023
1 parent 101095c commit 9594e62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/vitest/src/node/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,11 @@ function normalizeCliOptions(argv: CliOptions): CliOptions {
}

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

try {
const ctx = await startVitest(mode, cliFilters.map(normalize), normalizeCliOptions(options))
if (!ctx?.shouldKeepServer())
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 9594e62

Please sign in to comment.