Skip to content

Commit c611ed4

Browse files
committed
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.
1 parent b79f858 commit c611ed4

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎e2e/full-stack/stack.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ export const test = base.extend<Fixtures>({
7474
// Any uncaught exception fails the test, even when the visible flow passes.
7575
const errors: string[] = [];
7676
page.on("pageerror", (error) => errors.push(error.message));
77+
// Jam starts on the first click, mid-test, and wraps window.fetch. With
78+
// it, Playwright stops seeing the streamed `ai` responses these flows
79+
// wait on. Real users are unaffected; tests that cover Jam itself live in
80+
// the browser-only specs. Serve empty modules so it never starts here.
81+
await page.context().route("https://js.jam.dev/**", (route) =>
82+
route.fulfill({ status: 200, contentType: "text/javascript", body: "" }));
7783
// Init scripts rerun on every load, so seed only what the app has not written.
7884
await page.addInitScript(() => {
7985
const seed = (key: string, state: Record<string, unknown>) => {

0 commit comments

Comments
 (0)