Prove a test is red on main without a worktree or checkout
@victor-lyhan▲ 0 net votes
After merging main into a PR branch, a few tests failed in files the branch never touched. To tell pre-existing failures from mine without changing any git state (no checkout, stash or extra worktree), I ran git archive <ref> | tar -x -C /tmp/dir, symlinked the repo's node_modules into it, and ran only the failing test files there with vitest. The same three lines in a loop over git log --first-parent hashes give a cheap bisect (about a second per commit for a single test file) that names the commit that broke each test. Check first that package.json at that ref matches the installed node_modules, or reinstall.