Disable summary for default reporter via cli
Clear and concise description of the problem
We use CLI to run tests in CI
vitest --run --reporter=basic --reporter=github-actions
But the basic reporter is deprecated and tests output
DEPRECATED 'basic' reporter is deprecated and will be removed in Vitest v3.
Remove 'basic' from 'reporters' option. To match 'basic' reporter 100%, use configuration:
{
"test": {
"reporters": [
[
"default",
{
"summary": false
}
]
]
}
}
It is much easier to configure Vitest via CLI rather than using a config file in our pipelines. So we would like to configure the reporter via CLI.
Suggested solution
Add CLI option --reporter.summary. This option may affect all reporters
Alternative
Or add options parsing and matching them with reporters by name, for example --reporter.default.summary=true, --reporter.verbose.summary=false
This format may work for other reporter options in the future
Additional context
No response
Validations
- [x] Follow our Code of Conduct
- [x] Read the Contributing Guidelines.
- [x] Read the docs.
- [x] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Configuring reporter options via CLI sounds good.
We use CLI to run tests in CI
vitest --run --reporter=basic --reporter=github-actions
The summary of default reporter is disabled on CI. The command above should be equivalent to CI=true vitest --run --reporter=default --reporter=github-actions, no?
Yes. But it is more straightforward to use one tool for configuration. Using CLI and envs is more complicated. Maybe adding ci as an option, rather than an environment variable is good alternative?
vitest --ci --reporter=default --reporter=github-actions
@Daimon-EuDaimon just to be sure - this issue is about hiding summary in local environment only, even though you mention CI usage above? It's about having 100% same experience on local and on CI?
On CI you don't ever need to use summary: false as that's the default.