(
dir: string,
vscodeBasePath: string | null,
)
| 336 | |
| 337 | describe("vscode base path injection", () => { |
| 338 | async function startServerAdvertising( |
| 339 | dir: string, |
| 340 | vscodeBasePath: string | null, |
| 341 | ) { |
| 342 | const server = await startStaticServer({ |
| 343 | port: 0, |
| 344 | host: "127.0.0.1", |
| 345 | dir, |
| 346 | routes: {}, |
| 347 | vscodeBasePath, |
| 348 | }); |
| 349 | servers.push(server); |
| 350 | const address = server.address(); |
| 351 | if (!address || typeof address === "string") { |
| 352 | throw new Error("Static server did not bind to a TCP port"); |
| 353 | } |
| 354 | return `http://127.0.0.1:${address.port}`; |
| 355 | } |
| 356 | |
| 357 | function makeBuildDir() { |
| 358 | const buildDir = mkdtempSync(path.join(tmpdir(), "agent-canvas-build-")); |
no test coverage detected