Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/cli/scripts/test-wrapper.mts
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,13 @@ async function main() {
...(WIN32 ? { shell: true } : {}),
}

// --passWithNoTests: a scoped run where the expanded args don't
// resolve to any test file should succeed rather than error with
// "No test files found". Keeps pre-commit hooks passing when an edit
// touches only non-testable code.
const result = await spawn(
vitestPath,
['run', ...expandedArgs],
['run', '--passWithNoTests', ...expandedArgs],
spawnOptions,
)
process.exitCode = result?.code || 0
Expand Down