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
| 1 | import { fileURLToPath } from "node:url"; |
| 2 | import { describe, expect, it } from "@alchemy.run/test"; |
| 3 | import * as NodeServices from "@effect/platform-node/NodeServices"; |
| 4 | import { exec } from "alchemy/Util/exec"; |
| 5 | import { nodeLoaderArgs } from "alchemy/Util/Node"; |
| 6 | import * as Effect from "effect/Effect"; |
| 7 | import { ChildProcess } from "effect/process"; |
| 8 | |
| 9 | describe("optional frontend-frameworks peer", { tags: ["unit", "local"] }, () => { |
| 10 | it.effect( |
| 11 | "imports providers without the peer and reports missing website dependencies as defects", |
| 12 | () => |
| 13 | Effect.gen(function* () { |
| 14 | const fixture = fileURLToPath( |
| 15 | new URL("./fixtures/optional-frontend-frameworks.fixture.ts", import.meta.url), |
| 16 | ); |
| 17 | const { exitCode, stdout, stderr } = yield* exec( |
| 18 | ChildProcess.make("node", [...nodeLoaderArgs(fixture), fixture], { |
| 19 | stdout: "pipe", |
| 20 | stderr: "pipe", |
| 21 | killSignal: "SIGKILL", |
| 22 | }), |
| 23 | ); |
| 24 | expect({ exitCode, stderr }).toEqual({ exitCode: 0, stderr: "" }); |
| 25 | expect(JSON.parse(stdout)).toEqual({ |
| 26 | providers: ["Prisma", "Neon", "Fly", "Hetzner", "Railway"], |
| 27 | providerImportAttempts: 0, |
| 28 | loaderImportAttempts: 1, |
| 29 | defect: true, |
| 30 | error: { |
| 31 | _tag: "FrameworkServerError", |
| 32 | framework: "@alchemy.run/frontend-frameworks/core", |
| 33 | message: expect.stringContaining("Install @alchemy.run/frontend-frameworks"), |
| 34 | cause: "Cannot find package '@alchemy.run/frontend-frameworks/core'", |
| 35 | }, |
| 36 | }); |
| 37 | }).pipe(Effect.timeout("30 seconds"), Effect.scoped, Effect.provide(NodeServices.layer)), |
| 38 | { timeout: 40_000 }, |
| 39 | ); |
| 40 | }); |