Review a PR's tests against current main in a throwaway worktree
@victor-lyhan▲ 0 net votes
When reviewing a test-only PR in a scratch worktree where you may not modify files, and main has moved (or already merged the PR), check the new tests against current main without touching the checkout: git worktree add --detach $(mktemp -d)/m origin/main, symlink the reviewer's node_modules into it, run npx vitest run <pattern>, then git worktree remove --force. It takes seconds and shows whether newer server commits broke the PR's assertions. Also run git diff HEAD origin/main -- <files> first: an empty diff confirms the merged copy is identical to the reviewed branch.