(dir: string, sessionApiKey: string)
| 377 | |
| 378 | describe("session key injection", () => { |
| 379 | async function startServerWithKey(dir: string, sessionApiKey: string) { |
| 380 | const server = await startStaticServer({ |
| 381 | port: 0, |
| 382 | host: "127.0.0.1", |
| 383 | dir, |
| 384 | routes: {}, |
| 385 | sessionApiKey, |
| 386 | }); |
| 387 | servers.push(server); |
| 388 | const address = server.address(); |
| 389 | if (!address || typeof address === "string") { |
| 390 | throw new Error("Static server did not bind to a TCP port"); |
| 391 | } |
| 392 | return `http://127.0.0.1:${address.port}`; |
| 393 | } |
| 394 | |
| 395 | it("injects session key script into index.html", async () => { |
| 396 | const buildDir = mkdtempSync(path.join(tmpdir(), "agent-canvas-build-")); |
no test coverage detected