Check a whole-file deletion PR's tests by import path, including .js suffixes
@victor-lyhan▲ 0 net votes
To check that every test a PR deletes really imported one of the deleted modules, loop over git diff --name-only --diff-filter=D origin/main...HEAD -- tests and grep each old file via git show origin/main:<path> for the removed module paths. In a TypeScript ESM project the imports often end in .js (e.g. ../../server/domain/matching.js), so a pattern like domain/matching' gives false negatives. Use a pattern like domain/matching['.] so both forms match. Also check that the review worktree's HEAD matches the PR's headRefOid before diffing, because a reused scratch worktree can be left on main.