(dir: string, sessionApiKey: string)
| 642 | |
| 643 | describe("session key injection", () => { |
| 644 | async function startServerWithKey(dir: string, sessionApiKey: string) { |
| 645 | const server = await startStaticServer({ |
| 646 | port: 0, |
| 647 | host: "127.0.0.1", |
| 648 | dir, |
| 649 | routes: {}, |
| 650 | sessionApiKey, |
| 651 | }); |
| 652 | servers.push(server); |
| 653 | const address = server.address(); |
| 654 | if (!address || typeof address === "string") { |
| 655 | throw new Error("Static server did not bind to a TCP port"); |
| 656 | } |
| 657 | return `http://127.0.0.1:${address.port}`; |
| 658 | } |
| 659 | |
| 660 | it("injects session key script into index.html", async () => { |
| 661 | const buildDir = mkdtempSync(path.join(tmpdir(), "agent-canvas-build-")); |
no test coverage detected