The best way to control Claude Code, Codex and more from any computer or phone

main
ts 59 lines 2.12 KB
Raw
1 import * as Railway from "@alchemy.run/railway";
2 import { describe, expect } from "@alchemy.run/test";
3 import * as Test from "@alchemy.run/test/Alchemy";
4 import * as Effect from "effect/Effect";
5 import * as pathe from "pathe";
6 import { cloneFixture } from "../../Cloudflare/Utils/Fixture.ts";
7 import { expectUrlContains } from "../../Cloudflare/Utils/Http.ts";
8
9 const { test } = Test.make({ providers: Railway.providers(), dev: true });
10
11 const fixtureDir = pathe.resolve(import.meta.dirname, "../../AWS/Website/fixtures/nuxt-app");
12 const tempRoot = pathe.resolve(import.meta.dirname, "../../../.tmp");
13 const fixtureEntries = [".gitignore", "package.json", "nuxt.config.ts", "app", "server", "public"];
14
15 describe(
16 "Railway.Website.Nuxt local",
17 { tags: ["provider:railway", "provider:railway:website", "local"] },
18 () => {
19 test.provider(
20 "dev runs the framework server with no cloud resources",
21 (stack) =>
22 Effect.gen(function* () {
23 yield* stack.destroy();
24
25 const rootDir = yield* cloneFixture(fixtureDir, {
26 prefix: "alchemy-nuxt-railway-local-",
27 tempRoot,
28 entries: fixtureEntries,
29 });
30
31 const deployed = yield* stack.deploy(
32 Effect.gen(function* () {
33 const site = yield* Railway.Website.Nuxt("Web", { rootDir });
34 return { site };
35 }),
36 );
37
38 const url = deployed.site.url;
39 expect(url).toMatch(/^http:\/\/(localhost|127\.0\.0\.1):\d+\/?$/);
40 expect(deployed.site.service).toBeUndefined();
41 expect(deployed.site.project).toBeUndefined();
42
43 yield* expectUrlContains(`${url}/`, "NUXT_AWS_PAGE_MARKER", {
44 timeout: "90 seconds",
45 label: "dev home page",
46 });
47 yield* expectUrlContains(`${url}/api/hello?echo=roundtrip`, "NUXT_AWS_API_MARKER", {
48 label: "api route (dev)",
49 });
50 yield* expectUrlContains(`${url}/prerendered`, "NUXT_AWS_PRERENDERED_MARKER", {
51 label: "extra route (dev)",
52 });
53
54 yield* stack.destroy();
55 }),
56 { timeout: 120_000 },
57 );
58 },
59 );