import { expect, test } from "@playwright/test"; /** * Stage-7 closure smoke — proves all four engines are mounted on the * SAME Bun.serve listener at distinct routes (no path collision). */ interface EngineDescriptor { readonly name: string; readonly path: string; readonly method: string; } test.describe("foundation-stack-engines — all engines mounted", () => { test("5. /internal/engines lists yoga + apollo + ws-bun + sse-bun", async ({ request, }) => { const res = await request.get("/internal/engines"); expect(res.status()).toBe(200); const body = (await res.json()) as { engines: ReadonlyArray; host: { wsConnections: number }; }; const names = body.engines.map((e) => e.name).sort(); expect(names).toEqual(["apollo", "sse-bun", "ws-bun", "yoga"]); const paths = body.engines.map((e) => e.path); expect(new Set(paths).size).toBe(paths.length); // no collisions expect(paths).toContain("/graphql/yoga"); expect(paths).toContain("/graphql/apollo"); expect(paths).toContain("/ws"); expect(paths).toContain("/sse"); }); });