()
| 6 | import { bootCloudflare } from "./cloudflare.boot"; |
| 7 | |
| 8 | export default async function setup(): Promise<(() => Promise<void>) | void> { |
| 9 | if (process.env.E2E_CLOUDFLARE_URL) { |
| 10 | await waitForHttp(`${process.env.E2E_CLOUDFLARE_URL}/api/account/me`); |
| 11 | return; |
| 12 | } |
| 13 | |
| 14 | // Claim, boot, and retry on EADDRINUSE (Linux-CI ephemeral squatter between |
| 15 | // probe and bind); the claimed port is published via env for the workers. |
| 16 | const { teardown } = await claimAndBoot( |
| 17 | [{ envVar: "E2E_CLOUDFLARE_PORT", offset: 5, label: "cloudflare wrangler dev" }], |
| 18 | async (ports) => { |
| 19 | const procs = await bootCloudflare({ port: ports.E2E_CLOUDFLARE_PORT! }); |
| 20 | return { teardown: procs.teardown, value: procs }; |
| 21 | }, |
| 22 | { label: "cloudflare" }, |
| 23 | ); |
| 24 | return teardown; |
| 25 | } |
nothing calls this directly
no test coverage detected