@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
ts 66 lines 2.13 KB
Raw
1 import * as GCP from "@alchemy.run/gcp";
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: GCP.providers(), dev: true });
10
11 const fixtureDir = pathe.resolve(
12 import.meta.dirname,
13 "../../AWS/Website/fixtures/tanstack-start-app",
14 );
15 const tempRoot = pathe.resolve(import.meta.dirname, "../../../.tmp");
16 const fixtureEntries = [".gitignore", "package.json", "vite.config.ts", "src", "public"];
17
18 describe(
19 "GCP.Website.TanStackStart local",
20 { tags: ["provider:gcp", "provider:gcp:website", "local"] },
21 () => {
22 test.provider(
23 "dev runs the framework server with no cloud resources",
24 (stack) =>
25 Effect.gen(function* () {
26 yield* stack.destroy();
27
28 const rootDir = yield* cloneFixture(fixtureDir, {
29 prefix: "alchemy-tanstack-start-gcp-local-",
30 tempRoot,
31 entries: fixtureEntries,
32 });
33
34 const deployed = yield* stack.deploy(
35 Effect.gen(function* () {
36 const site = yield* GCP.Website.TanStackStart("Web", {
37 rootDir,
38 });
39 return { site };
40 }),
41 );
42
43 const url = deployed.site.url;
44 expect(url).toMatch(/^http:\/\/(localhost|127\.0\.0\.1):\d+\/?$/);
45 expect(deployed.site.service).toBeUndefined();
46
47 const origin = String(url).replace(/\/+$/, "");
48 yield* expectUrlContains(`${origin}/`, "TANSTACK_AWS_PAGE_MARKER", {
49 timeout: "90 seconds",
50 label: "dev home page",
51 });
52 yield* expectUrlContains(
53 `${origin}/api/hello?echo=roundtrip`,
54 "TANSTACK_AWS_API_MARKER",
55 { label: "api route (dev)" },
56 );
57
58 yield* stack.destroy();
59 }),
60 {
61 tags: ["provider:gcp", "provider:gcp:website", "live"],
62 timeout: 120_000,
63 },
64 );
65 },
66 );