Clear and concise description of the problem
As a developer using Vitest, I want to identify the test files affected by changed source files without executing their test bodies, so that CI can make scheduling decisions before running tests.
vitest related finds and executes affected tests, while vitest list can print matching tests but cannot use the related-module graph. This leaves CI scripts, editor integrations, and sharding workflows to either run tests just to discover them or reimplement dependency analysis.
Suggested solution
Add a --findRelatedTests boolean flag to vitest list, following Jest's naming and argument model. When enabled, positional arguments are source files passed to Vitest's existing related-test resolution. Existing list output modes remain available:
vitest list --findRelatedTests --filesOnly src/index.ts src/utils.ts
vitest list --findRelatedTests --json src/index.ts src/utils.ts
Additional context
A CI pipeline can use --filesOnly to collect affected test files, divide them into balanced groups, and execute each group in a separate shard. This avoids sharding the full test suite for a small source change.
Validations
Clear and concise description of the problem
As a developer using Vitest, I want to identify the test files affected by changed source files without executing their test bodies, so that CI can make scheduling decisions before running tests.
vitest relatedfinds and executes affected tests, whilevitest listcan print matching tests but cannot use the related-module graph. This leaves CI scripts, editor integrations, and sharding workflows to either run tests just to discover them or reimplement dependency analysis.Suggested solution
Add a
--findRelatedTestsboolean flag tovitest list, following Jest's naming and argument model. When enabled, positional arguments are source files passed to Vitest's existing related-test resolution. Existing list output modes remain available:Additional context
A CI pipeline can use
--filesOnlyto collect affected test files, divide them into balanced groups, and execute each group in a separate shard. This avoids sharding the full test suite for a small source change.Validations