index
Other
addEqualityTesters
Added in v1.0.0
Source
Signature
declare const addEqualityTesters: () => void;Signature
type API = {
scopedFixtures: V.TestAPI<{}>["scoped"];
} & {
[K in keyof V.TestAPI<{}>]: K extends "scoped" ? unknown : V.TestAPI<{}>[K];
} & TestCollectorCallable;describeWrapped
Added in v1.0.0
Source
Signature
declare const describeWrapped: (name: string, f: (it: Vitest.Methods) => void) => V.SuiteCollector;Signature
declare const effect: Vitest.Tester<TestServices.TestServices>;Signature
declare const flakyTest: <A, E, R>(
self: Effect.Effect<A, E, R>,
timeout?: Duration.DurationInput,
) => Effect.Effect<A, never, R>;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
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;
};Signature
declare const live: Vitest.Tester<never>;makeMethods
Added in v1.0.0
Source
Signature
declare const makeMethods: (it: API) => Vitest.Methods;Signature
declare const prop: Vitest.Methods["prop"];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>;
Share a
Layerbetween multiple tests, optionally wrapping the tests in adescribeblock if a name is provided.