#54 follow-up: pretest:e2e cleans out/test (stop stale cross-branch compiled tests running) #56
Reference in New Issue
Block a user
Delete Branch "s54-pretest-clean"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Build-hygiene follow-up to #54.
tsc -p tsconfig.e2e.jsonnever removes outputs for test sources absent on the current branch, so staleout/test/e2e/suite/*.test.jsfrom other branches were run by the suite glob (caused cross-branch test confusion in session 0048). Adds aclean:e2escript (nodefs.rmSync('out/test',{recursive,force})) run betweenbuildandtscinpretest:e2e; cleans ONLYout/test, never the esbuild bundle inout/.\n\nVerified: a planted staleout/test/.../zz.test.jsis removed bypretest:e2e; E2E stays green (73 passing + 1 pending, both passes exit 0).`tsc -p tsconfig.e2e.json` emits to `out/` but never removes outputs for test sources absent on the current branch, so stale compiled `out/test/e2e/suite/*.test.js` from other branches were picked up and run by the suite glob (`**/*.test.js`) — this caused real cross-branch test confusion in session 0048 (a deleted probe + another branch's tests ran on an unrelated branch). Add a `clean:e2e` script (`fs.rmSync('out/test', {recursive, force})` via node, so no shell `rm` dependency) and run it between `build` and `tsc` in `pretest:e2e`. Cleans ONLY `out/test` — never `out/`, which holds the just-built esbuild bundle (`out/extension.cjs`, `out/media`). Verified: planting a stale `out/test/.../zz.test.js` then running `pretest:e2e` removes it, and the E2E suite stays green (73 passing + 1 pending, both passes exit 0). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>