From 911ed216714a8ec5cf2a890afef3a173f287eecd Mon Sep 17 00:00:00 2001 From: Ben Stull Date: Sat, 13 Jun 2026 09:21:31 -0700 Subject: [PATCH] #54 follow-up: pretest:e2e cleans out/test before recompiling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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) --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b08e4ab..dbd4c74 100644 --- a/package.json +++ b/package.json @@ -202,7 +202,8 @@ "watch": "node esbuild.mjs --watch", "typecheck": "tsc --noEmit", "test": "vitest run", - "pretest:e2e": "npm run build && tsc -p tsconfig.e2e.json", + "clean:e2e": "node -e \"require('fs').rmSync('out/test',{recursive:true,force:true})\"", + "pretest:e2e": "npm run build && npm run clean:e2e && tsc -p tsconfig.e2e.json", "test:e2e": "node ./out/test/e2e/runTest.js", "smoke:live": "npm run build && node scripts/smoke-live-turn.mjs", "vscode:prepublish": "node esbuild.mjs" -- 2.39.5