(dir: string, sessionApiKey: string)
| 242 | |
| 243 | describe("session key injection", () => { |
| 244 | async function startServerWithKey(dir: string, sessionApiKey: string) { |
| 245 | const server = await startStaticServer({ |
| 246 | port: 0, |
| 247 | host: "127.0.0.1", |
| 248 | dir, |
| 249 | routes: {}, |
| 250 | sessionApiKey, |
| 251 | }); |
| 252 | servers.push(server); |
| 253 | const address = server.address(); |
| 254 | if (!address || typeof address === "string") { |
| 255 | throw new Error("Static server did not bind to a TCP port"); |
| 256 | } |
| 257 | return `http://127.0.0.1:${address.port}`; |
| 258 | } |
| 259 | |
| 260 | it("injects session key script into index.html", async () => { |
| 261 | const buildDir = mkdtempSync(path.join(tmpdir(), "agent-canvas-build-")); |
no test coverage detected