/** @effect-diagnostics anyUnknownInErrorContext:off */ /** * Test adapter for the `alchemy-test` runner (see `packages/alchemy-test`). * * Same shape as {@link "./Vitest.ts"} / {@link "./Bun.ts"}, but registers * tests as raw Effects with the alchemy-test harness so the single-process * runner can inject a buffering Logger/Console per test and manage * concurrency + timeouts itself. */ import { type TestOptions } from "alchemy-test"; import * as Effect from "effect/Effect"; import type { AlchemyContext } from "../AlchemyContext.ts"; import type { CompiledStack } from "../Stack.ts"; import type { Stage } from "../Stage.ts"; import * as Core from "./Core.ts"; export { executeWhenReady, getWhenReady, guardContentType, guardedFetchLayer, rpcClientLayer, WorkerNotReady, type EdgeGuardOptions, type WhenReadyOptions, } from "./Http.ts"; export type MakeOptions = Core.MakeOptions; export type ScratchStack = Core.ScratchStack; export type TestEffect = Core.TestEffect; export declare const ALCHEMY_TEST_DEV: import("effect/Config").Config>; export declare const resolveDev: typeof Core.resolveDev; interface TestFn { (name: string, eff: TestEffect, options?: TestOptions): void; skip: (name: string, eff: TestEffect, options?: TestOptions) => void; skipIf: (condition: boolean) => (name: string, eff: TestEffect, options?: TestOptions) => void; only: (name: string, eff: TestEffect, options?: TestOptions) => void; todo: (name: string, eff: TestEffect, options?: TestOptions) => void; provider: ProviderFn; } interface ProviderFn { (name: string, fn: (stack: ScratchStack) => Effect.Effect, options?: TestOptions): void; skip: (name: string, fn: (stack: ScratchStack) => Effect.Effect, options?: TestOptions) => void; skipIf: (condition: boolean) => (name: string, fn: (stack: ScratchStack) => Effect.Effect, options?: TestOptions) => void; } interface BeforeAllFn { (eff: TestEffect, options?: TestOptions): Effect.Effect; } interface BeforeEachFn { (eff: TestEffect, options?: TestOptions): void; } interface AfterAllFn { (eff: TestEffect, options?: TestOptions): void; skipIf: (predicate: boolean) => (eff: TestEffect, options?: TestOptions) => void; } interface AfterEachFn { (eff: TestEffect, options?: TestOptions): void; } export interface TestApi { test: TestFn; beforeAll: BeforeAllFn; beforeEach: BeforeEachFn; afterAll: AfterAllFn; afterEach: AfterEachFn; deploy: (stack: TestEffect, Stage | AlchemyContext>, options?: { stage?: string; }) => ReturnType>; destroy: (stack: TestEffect, options?: { stage?: string; }) => ReturnType; } /** * Build the per-file test API. Configure providers / state once at the top of * the test file: * * ```ts * import * as Test from "@/Test/Alchemy"; * import * as Cloudflare from "@/Cloudflare"; * * const { test, deploy, destroy, beforeAll, afterAll } = Test.make({ * providers: Cloudflare.providers(), * state: Cloudflare.state(), * }); * ``` */ export declare const make: (options: MakeOptions) => TestApi; //# sourceMappingURL=Alchemy.d.ts.map