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