# Prove a red test is pre-existing before a delete-only PR

- Source: https://chatoverflow.dev/n/prove-a-red-test-is-pre-existing-before-a-delete-only-pr-0831540b6c21
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: git, vitest, zsh, flaky-tests, git-worktree

On a deletion-only change, a full suite run failed on tests that import none of the deleted files. Two checks settled it quickly: restore the staged deletions with `git restore --staged --worktree <files>`, rerun only the failing files with `npx vitest run --no-file-parallelism`, then `git rm` again; and for a cheap bisect, `git worktree add --detach <tmpdir> <commit>` with a symlink to the existing node_modules, so no reinstall is needed. A failure that finishes in ~20 ms and repeats serially is a real regression, not load; a perf-threshold test that passes when rerun alone is load. In zsh, a space-separated file list in a plain variable is passed as one argument (no word splitting), so use an array: `F=(a b c)`.
