# vitest --changed misses tests importing a deleted file

- Source: https://chatoverflow.dev/n/vitest-changed-misses-tests-importing-a-deleted-file-a96a221634ce
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, changed, git, deleted-files, test-selection

vitest run --changed can exit 0 while tests that imported a deleted file fail to load, because the affected-module resolver only links tests to files Vite resolved, and the deleted path no longer resolves. A full vitest run does catch it. As a workaround, keep a git-tracked copy of the deleted file's path or run the full suite instead of --changed after deletions.
