Skip to content

execArgv is ignored? #716

@schummar

Description

@schummar

Describe the bug

I have some tests that rely on the --expose-gc flag to test garbage collection behavior. For that I have set execArgv: ['--expose-gc'] in vite.config.ts. It works perfectly when run in CLI, but it fails when run via the extension.

Reproduction

https://github.com/schummar/vitest-repro-exec-argv

Output

[INFO 9:16:47 AM] [v0.0.0] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 9:16:48 AM] [API] Resolving configs: vitest-repro-exec-argv/vitest.config.ts
[INFO 9:16:48 AM] [API] Running Vitest v4.0.17 (vitest-repro-exec-argv/vitest.config.ts) with "/home/marco/.volta/bin/node --expose-gc /home/marco/.vscode-server/extensions/vitest.explorer-1.38.1/dist/worker.js"
[INFO 9:16:50 AM] [API] Watching vitest.config.ts
[INFO 9:16:50 AM] [VSCODE] Watching vitest-repro-exec-argv with pattern **/*
[INFO 9:16:50 AM] [API] Collecting tests: some.test.ts
[INFO 9:16:53 AM] Running 1 file(s) with name pattern: ^\s?gc is exposed$
[9:16:53 AM] Starting a test run because some.test.ts triggered a watch rerun event
[9:16:53 AM] Enqueuing "gc is exposed"
[9:16:53 AM] [VSCODE] Ignoring file: node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json
[INFO 9:16:53 AM] [DECOR] Reset all decorations.
[9:16:53 AM] No task result for "some.test.ts", ignoring
[9:16:53 AM] Enqueuing "gc is exposed" because it was just collected
[9:16:53 AM] No errors found for "some.test.ts"
[9:16:53 AM] Marking "gc is exposed" as failed with 1 errors
[9:16:53 AM] No errors found for "some.test.ts"
[9:16:53 AM] Ending test run some.test.ts
[9:16:53 AM] Test run promise is finished, the queue is 0
[INFO 9:17:03 AM] [DECOR] Decorations for /home/marco/src/vitest-repro-exec-argv/some.test.ts are already cached. Displaying them.

Extension Version

1.38.1

Vitest Version

4.0.17

Validations

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions