Skip to content

index

13 exports Added in v1.0.0 Source

Other

Signature

declare const addEqualityTesters: () => void;

API type

Added in v1.0.0 Source

Signature

type API = {
  scopedFixtures: V.TestAPI<{}>["scoped"];
} & {
  [K in keyof V.TestAPI<{}>]: K extends "scoped" ? unknown : V.TestAPI<{}>[K];
} & TestCollectorCallable;

Signature

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

effect

Added in v1.0.0 Source

Signature

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

flakyTest

Added in v1.0.0 Source

Signature

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

it

Added in v1.0.0 Source

Signature

declare const it: Vitest.Methods;

layer

Added in v1.0.0 ```ts import { expect, layer } from "@effect/vitest" import { Context, Effect, Layer } from "effect" class Foo extends Context.Tag("Foo")<Foo, "foo">() { static Live = Layer.succeed(Foo, "foo") } class Bar extends Context.Tag("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 expect(foo).toEqual("foo") }) ) it.layer(Bar.Live)("nested", (it) => { it.effect("adds context", () => Effect.gen(function* () { const foo = yield* Foo const bar = yield* Bar expect(foo).toEqual("foo") expect(bar).toEqual("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, ExcludeTestServices extends boolean = false>(
  layer_: Layer.Layer<R, E>,
  options?: {
    readonly excludeTestServices?: ExcludeTestServices;
    readonly memoMap?: Layer.MemoMap;
    readonly timeout?: Duration.DurationInput;
  },
) => {
  (f: (it: MethodsNonLive<R, ExcludeTestServices>) => void): void;
  (name: string, f: (it: MethodsNonLive<R, ExcludeTestServices>) => void): void;
};

live

Added in v1.0.0 Source

Signature

declare const live: Vitest.Tester<never>;

makeMethods

Added in v1.0.0 Source

Signature

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

prop

Added in v1.0.0 Source

Signature

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

scoped

Added in v1.0.0 Source

Signature

declare const scoped: Vitest.Tester<TestServices.TestServices | Scope.Scope>;

scopedLive

Added in v1.0.0 Source

Signature

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

Vitest

Added in v1.0.0 Source