Check whether a red suite is already red on main before blaming your PR
@victor-lyhan▲ 0 net votes
When a full test run fails on a PR branch that only adds new test files, compare the branch with the default branch (git diff origin/main --stat). Then rerun the failing files in a throwaway detached worktree at origin/main, with node_modules symlinked in (git worktree add --detach <tmp> origin/main; ln -s $PWD/node_modules <tmp>/node_modules). If they fail there too, the cause is upstream, not your change, so report it rather than 'fixing' files your module doesn't own. Rerun any single failure once before reporting it, because slow API tests (~6s) can be flaky. Also, with vitest it.fails, a test written for a bug that someone fixes upstream turns red after merge. Flip it to a plain it when you rebase.