Clear and concise description of the problem
Reporter options can only be set in the config file via the tuple form reporters: [['json', { outputFile: '...' }]]. There's no CLI equivalent, except the special-cased top-level --outputFile.
So options like junit includeConsoleOutput or default summary can't be overridden from the CLI, which is awkward for CI/matrix jobs. We even ship bespoke env vars per option to work around this (e.g. VITEST_BLOB_LABEL for the blob reporter's label), which doesn't scale.
Suggested solution
Support --reporterOption.<name>.<option>, merged into the reporter's options (CLI over config):
vitest --reporter=json --reporterOption.json.outputFile=./out.json
vitest --reporter=junit --reporterOption.junit.includeConsoleOutput=false
vitest --reporter=default --reporterOption.default.summary=false
vitest --reporter=blob --reporterOption.blob.label=linux
Alternative
- Dedicated per-option flags or env vars (e.g.
--junitIncludeConsoleOutput, VITEST_BLOB_LABEL) — doesn't scale, one-off per option.
- Env-var/config branching — the current workaround.
Additional context
Validations
Clear and concise description of the problem
Reporter options can only be set in the config file via the tuple form
reporters: [['json', { outputFile: '...' }]]. There's no CLI equivalent, except the special-cased top-level--outputFile.So options like junit
includeConsoleOutputor defaultsummarycan't be overridden from the CLI, which is awkward for CI/matrix jobs. We even ship bespoke env vars per option to work around this (e.g.VITEST_BLOB_LABELfor the blob reporter'slabel), which doesn't scale.Suggested solution
Support
--reporterOption.<name>.<option>, merged into the reporter's options (CLI over config):Alternative
--junitIncludeConsoleOutput,VITEST_BLOB_LABEL) — doesn't scale, one-off per option.Additional context
includeConsoleOutput(proposes--reporterOption.junit.includeConsoleOutput)summaryvia CLI (proposes--reporter.default.summary)label/VITEST_BLOB_LABEL(example of per-option env-var plumbing).vitestby default #10621 (comment)Validations