From c611ed426618a3a5435cdff69dfbd047e1735ae3 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 22 Oct 2026 21:58:43 +0000 Subject: [PATCH] Keep Jam out of the full-stack e2e harness Jam now starts on the first click (#196), mid-test, and wraps window.fetch. After that the lib-add recipe can no longer read the streamed ai response in Playwright. Serve empty Jam modules from the full-stack page fixture, which the gate and the verify recipes share. The app loader is unchanged. --- e2e/full-stack/stack.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/e2e/full-stack/stack.ts b/e2e/full-stack/stack.ts index e47a95432..e873ca69c 100644 --- a/e2e/full-stack/stack.ts +++ b/e2e/full-stack/stack.ts @@ -74,6 +74,12 @@ export const test = base.extend({ // Any uncaught exception fails the test, even when the visible flow passes. const errors: string[] = []; page.on("pageerror", (error) => errors.push(error.message)); + // Jam starts on the first click, mid-test, and wraps window.fetch. With + // it, Playwright stops seeing the streamed `ai` responses these flows + // wait on. Real users are unaffected; tests that cover Jam itself live in + // the browser-only specs. Serve empty modules so it never starts here. + await page.context().route("https://js.jam.dev/**", (route) => + route.fulfill({ status: 200, contentType: "text/javascript", body: "" })); // Init scripts rerun on every load, so seed only what the app has not written. await page.addInitScript(() => { const seed = (key: string, state: Record) => {