Allow passing --changed cli option to vitest
- Dominant language
- TypeScript
- Stars
- 27k
- Forks
- 11.8k
- Avg merge
- 14h 23m
- Merged PRs (30d)
- 162
Description
### Command
test
### Description
The `unit-test` builder does not provide a way to use the `--changed` vitest option: https://vitest.dev/guide/cli.html#changed. This will analyze the import graph and only run tests affected by a change, which is useful for running a subset of the test suite for pull requests. This option is not available through the vitest configuration file.
### Describe the solution you'd like
Add a `changed: ` option to the `unit-test` builder options which passes `--changed ` to the vitest runner.
### Describe alternatives you've considered
I don't think there are any good workarounds. Using `@analogjs/vitest-angular` exposes vitest directly, but requires more setup and is not an "official" package.
Contributor guide
Research direction
Start at the unit-test builder options and trace how they are passed to the Vitest runner. Verify that a changed string option forwards --changed and that the relevant builder tests cover the resulting command.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, testing
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100