The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { expect } from "@alchemy.run/test"; |
| 2 | import type { ScratchStack } from "@alchemy.run/test/Alchemy"; |
| 3 | import { scratchStack } from "@alchemy.run/test/Core"; |
| 4 | import * as Effect from "effect/Effect"; |
| 5 | import { throughProxy } from "./transport.ts"; |
| 6 | |
| 7 | /** Fresh engine/provider/state layers address the same durable test.provider rows. */ |
| 8 | export const engineActor = (parent: ScratchStack, title: string, file: string, endpoint?: string) => |
| 9 | Effect.sync(() => { |
| 10 | const actor = scratchStack( |
| 11 | { |
| 12 | providers: throughProxy(() => endpoint), |
| 13 | stage: parent.stage, |
| 14 | }, |
| 15 | title, |
| 16 | file, |
| 17 | ); |
| 18 | expect(actor.name).toBe(parent.name); |
| 19 | expect(actor.stage).toBe(parent.stage); |
| 20 | expect(actor.state).not.toBe(parent.state); |
| 21 | return actor; |
| 22 | }); |