You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Extensible VCS Adapter System for Changed Test Detection #9863
Summary:
Add a plugin/extension point system to Vitest to support custom VCS (Version Control System) commands for detecting changed files. This is essential for efficiently running tests in large monorepos that use VCS systems other than Git (e.g., Mercurial, SVN) or require custom change-detection logic.
Problem:
Currently, Vitest's --changed flag and related functionality rely on Git to determine which files have been modified. This creates limitations for developers in enterprise environments where:
Legacy codebases use Mercurial (hg), Subversion (svn), or other VCS systems
Custom version control systems or proprietary solutions are in use
The default Git-based change detection doesn't work with alternative VCS workflows
Large monorepos require specialized change detection logic for optimal performance
Suggested solution
Implementation Details:
Configuration Option: Add a vcsCommand field in Vitest configuration:
exportdefaultdefineConfig({vcsCommand: 'hg status --modified --added --no-status --print0 | xargs -0'})
Standard Interface: The custom command should output changed file paths (relative to project root), one per line, to stdout.
Fallback Behavior: Maintain current Git-based detection as default when no custom command is specified.
Environment Variables: Support dynamic command configuration through environment variables for CI/CD flexibility.
Example Usage:
For Mercurial users:
export default defineConfig({
vcsCommand: 'hg status --modified --added --no-status'
})
Activity
sheremet-va commentedon Mar 14, 2026
I think we could expose a way to specify your own VSC "provider". In the builtin git one we only have a single public method:
Similarly like we do with the sequencer, for example:
Or better just an object with that field: