[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix(cli): parse `--execArgv` as array (#8924)

authored by

Ari Perkkiö and committed by
GitHub
(Nov 3, 2025, 9:19 PM +0100) 751c3926 c9078a26

+16
+5
docs/config/index.md
··· 724 724 725 725 - **Type:** `string[]` 726 726 - **Default:** `[]` 727 + - **CLI:** `--execArgv=<flag-1> --execArgv=<flag-2>` 727 728 728 729 Pass additional arguments to `node` in the runner worker. See [Command-line API | Node.js](https://nodejs.org/docs/latest/api/cli.html) for more information. 730 + 731 + ```sh 732 + vitest --execArgv=--cpu-prof --execArgv=--cpu-prof-dir=./cpu-profile 733 + ``` 729 734 730 735 :::warning 731 736 Be careful when using, it as some options may crash worker, e.g. --prof, --title. See https://github.com/nodejs/node/issues/41103.
+10
test/core/test/cli-test.test.ts
··· 511 511 const expected = Object.keys(ReportersMap) 512 512 expect(new Set(listed)).toEqual(new Set(expected)) 513 513 }) 514 + 515 + test('execArgv can be passed', async () => { 516 + expect(getCLIOptions('--execArgv=--cpu-prof')).toEqual({ 517 + execArgv: ['--cpu-prof'], 518 + }) 519 + 520 + expect(getCLIOptions('--execArgv=--cpu-prof --execArgv=--cpu-prof-dir=./cpu')).toEqual({ 521 + execArgv: ['--cpu-prof', '--cpu-prof-dir=./cpu'], 522 + }) 523 + })
+1
packages/vitest/src/node/cli/cli-config.ts
··· 408 408 execArgv: { 409 409 description: 'Pass additional arguments to `node` process when spawning `worker_threads` or `child_process`.', 410 410 argument: '<option>', 411 + array: true, 411 412 }, 412 413 vmMemoryLimit: { 413 414 description: