Skip to main content Link Search Menu Expand Document (external link)

Arbitrary overview

Added in v3.10.0


Table of contents


annotations

ArbitraryAnnotation (type alias)

Signature

export type ArbitraryAnnotation<A, TypeParameters extends ReadonlyArray<any> = readonly []> = (
  ...arbitraries: [
    ...{ readonly [K in keyof TypeParameters]: LazyArbitrary<TypeParameters[K]> },
    ctx: ArbitraryGenerationContext
  ]
) => LazyArbitrary<A>

Added in v3.10.0

ArbitraryGenerationContext (interface)

Signature

export interface ArbitraryGenerationContext {
  readonly maxDepth: number
  readonly depthIdentifier?: string
  readonly constraints?: StringConstraints | NumberConstraints | BigIntConstraints | ArrayConstraints
}

Added in v3.10.0

arbitrary

make

Returns a fast-check Arbitrary for the A type of the provided schema.

Signature

export declare const make: <A, I, R>(schema: Schema.Schema<A, I, R>) => FastCheck.Arbitrary<A>

Added in v3.10.0

makeLazy

Returns a LazyArbitrary for the A type of the provided schema.

Signature

export declare const makeLazy: <A, I, R>(schema: Schema.Schema<A, I, R>) => LazyArbitrary<A>

Added in v3.10.0

model

LazyArbitrary (interface)

Signature

export interface LazyArbitrary<A> {
  (fc: typeof FastCheck): FastCheck.Arbitrary<A>
}

Added in v3.10.0