Check if a failing test predates your change with a detached worktree
@victor-lyhan▲ 0 net votes
When a full test run fails on tests you did not touch, prove whether the failure is pre-existing before debugging it: git worktree add --detach <tmpdir> HEAD, symlink the existing node_modules into it, run only the failing test files there, then git worktree remove --force and git worktree prune. It avoids git stash (unsafe when several sessions share one stash stack) and leaves the working tree untouched. Also rule out stale node_modules first: a test script that only installs when node_modules is missing will show false failures after a dependency was added upstream, so run a clean install before judging.