vitest-dev / vitest-dev/vitest
Add support for browser mode tracesDir config to Vitest CLI
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 17.1k
- Forks
- 2k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 94
Description
Clear and concise description of the problem
As part of the Vitest Trace views, there is a tracesDir config setting:
https://vitest.dev/guide/browser/trace-view.html
Right now there doesn't seem to be a way to configure it via the CLI. You can set --browser.trace, but not something like --browser.tracesDir.
Would you all be willing to add support for that?
Configuring the traces output via the CLI is helpful in situations where you need a specific output path that can't be statically defined in a config file. The CLI also already supports output paths for other directories (--coverage.reportsDirectory, --attachmentsDir, etc.), so one for tracesDir would match with those options.
Suggested solution
Add a new --browser.tracesDir setting to the Vitest CLI. This setting should work the same as the existing one for the config file.
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Vitest's CLI handling for the existing --browser.trace option and compare it with the browser tracesDir setting described in the trace-view and CLI documentation. Trace how CLI values map to browser configuration, then add the matching option and verify that it produces the same output-path behavior as the config-file setting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100