Skip to content

Commit

Permalink
feat: include "vitest" in the process name (#4191)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va authored Sep 28, 2023
1 parent dd98279 commit 404c1f4
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 @@ -167,6 +167,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 404c1f4

Please sign in to comment.