The best way to control Claude Code, Codex and more from any computer or phone
| 1 | /** |
| 2 | * `alchemy dev` end-to-end: spawns the real CLI and runs the same checks as |
| 3 | * `integ.test.ts` against the local dev server. |
| 4 | */ |
| 5 | import { afterAll, test } from "bun:test"; |
| 6 | import * as path from "node:path"; |
| 7 | import { DevCli, fetchOk } from "@alchemy.run/test/DevCli"; |
| 8 | import { checkAssets, checkCallables, checkMcp, checkSchedule } from "./checks.ts"; |
| 9 | |
| 10 | const root = path.resolve(import.meta.dirname, ".."); |
| 11 | const cli = new DevCli({ root, stage: "dev-cli-test" }); |
| 12 | |
| 13 | afterAll(async () => { |
| 14 | await cli.stop(); |
| 15 | if (!process.env.NO_DESTROY) { |
| 16 | cli.destroy(); |
| 17 | } |
| 18 | }, 180_000); |
| 19 | |
| 20 | test("alchemy dev serves the client, the agents and the MCP server", async () => { |
| 21 | cli.destroy(); |
| 22 | cli.start(); |
| 23 | const url = (await cli.outputUrlWhenReady("url", { tries: 300, delayMs: 1000 })).replace( |
| 24 | /\/$/, |
| 25 | "", |
| 26 | ); |
| 27 | await fetchOk(url); |
| 28 | await checkAssets(url); |
| 29 | await checkCallables(url); |
| 30 | await checkSchedule(url); |
| 31 | await checkMcp(url); |
| 32 | }, 600_000); |