Skip to content

index

11 exports Added in v4.0.0 Source

Other

Signature

declare const addEqualityTesters: () => void;

API type

Added in v4.0.0 Source

Signature

type API = V.TestAPI<{}>;

Signature

declare const describeWrapped: (name: string, f: (it: Vitest.Methods) => void) => V.SuiteCollector;

effect

Added in v4.0.0 Source

Signature

declare const effect: Vitest.Tester<Scope.Scope>;

flakyTest

Added in v4.0.0 Source

Signature

declare const flakyTest: <A, E, R>(
  self: Effect.Effect<A, E, R | Scope.Scope>,
  timeout?: Duration.Input,
) => Effect.Effect<A, never, R>;

it

Added in v4.0.0 Source

Signature

declare const it: Vitest.Methods;

layer

Added in v4.0.0 ```ts import { assert, layer } from "@effect/vitest" import { Effect, Layer, Context } from "effect" class Foo extends Context.Service<Foo, "foo">()("Foo") { static Live = Layer.succeed(Foo, "foo") } class Bar extends Context.Service<Bar, "bar">()("Bar") { static Live = Layer.effect( Bar, Effect.map(Foo, () => "bar" as const) ) } layer(Foo.Live)("layer", (it) => { it.effect("adds context", () => Effect.gen(function*() { const foo = yield* Foo assert.strictEqual(foo, "foo") })) it.layer(Bar.Live)("nested", (it) => { it.effect("adds context", () => Effect.gen(function*() { const foo = yield* Foo const bar = yield* Bar assert.strictEqual(foo, "foo") assert.strictEqual(bar, "bar") })) }) }) ``` Source

Share a Layer between multiple tests, optionally wrapping the tests in a describe block if a name is provided.

Signature

declare const layer: <R, E>(
  layer_: Layer.Layer<R, E>,
  options?: {
    readonly excludeTestServices?: boolean;
    readonly memoMap?: Layer.MemoMap;
    readonly timeout?: Duration.Input;
  },
) => {
  (f: (it: MethodsNonLive<R>) => void): void;
  (name: string, f: (it: MethodsNonLive<R>) => void): void;
};

live

Added in v4.0.0 Source

Signature

declare const live: Vitest.Tester<Scope.Scope>;

makeMethods

Added in v4.0.0 Source

Signature

declare const makeMethods: (it: V.TestAPI) => Vitest.Methods;

prop

Added in v4.0.0 Source

Signature

declare const prop: Vitest.Methods["prop"];

Vitest

Added in v4.0.0 Source