arbitrary
API reference for @effx/ir/arbitrary
arbitrary.ts overview
Exports Grouped by Category
utils
PropertyOptions (interface)
How many values a property check generates and, to replay a run, the seed it draws them from.
Signature
export interface PropertyOptions {
readonly runs?: number | undefined
readonly seed?: string | number | undefined
}arbitraryEdge
Signature
declare const arbitraryEdge: () => Arbitrary.Arbitrary<Edge>arbitraryIR
Testing adapter around effect/Arbitrary (unstable). The only module that imports it.
Derivation is lazy because it can throw for schemas the unstable implementation
cannot compile; callers see that at the call site, not at import time.
Signature
declare const arbitraryIR: () => Arbitrary.Arbitrary<ApplicationIR>arbitraryNode
Signature
declare const arbitraryNode: () => Arbitrary.Arbitrary<Node>arbitraryOf
An Arbitrary for the decoded Type of any Schema. Derivation is immediate and throws when the
unstable implementation cannot compile the schema; callers that must not throw wrap the call.
Signature
declare const arbitraryOf: <S extends Schema.Constraint>(schema: S) => Arbitrary.Arbitrary<S["Type"]>falsification
Checks property over values of arbitrary. Succeeds with undefined when it held for every generated
value, otherwise with the formatted falsification (shrunk input, failure, replay token). A defect or an
interruption in property is not a falsification and keeps propagating.
Signature
declare const falsification: <A, E = never, R = never>(
arbitrary: Arbitrary.Arbitrary<A>,
property: (value: A) => boolean | Effect.Effect<boolean, E, R>,
options?: PropertyOptions
) => Effect.Effect<string | undefined, never, R>sampleIR
Signature
declare const sampleIR: (count: number) => Effect.Effect<ReadonlyArray<ApplicationIR>, Arbitrary.SampleError>