Options
All
  • Public
  • Public/Protected
  • All
Menu

API Reference | fast-check | Property based testing framework

Index

Enumerations

Classes

Interfaces

Type aliases

Variables

Functions

Type aliases

AsyncPropertyHookFunction

AsyncPropertyHookFunction: ((previousHookFunction: GlobalAsyncPropertyHookFunction) => Promise<unknown>) | ((previousHookFunction: GlobalAsyncPropertyHookFunction) => void)

Type of legal hook function that can be used to call beforeEach or afterEach on a IAsyncPropertyWithHooks

remarks

Since 2.2.0

CloneValue

CloneValue<T, N>: N extends 0 ? [] : N extends 1 ? [T] : N extends 2 ? [T, T] : N extends 3 ? [T, T, T] : N extends 4 ? [T, T, T, T] : T[]

Type of the value produced by clone

remarks

Since 2.5.0

Type parameters

  • T

  • N: number

Context

Context: ContextValue
deprecated

Switch to ContextValue instead

remarks

Since 1.8.0

DedupValue

DedupValue<T, N>: CloneValue<T, N>
deprecated

Switch to CloneValue instead

remarks

Since 2.2.0

Type parameters

  • T

  • N: number

DoubleConstraints

DoubleConstraints: { max?: number; min?: number; next?: false } | ({ next: true } & DoubleNextConstraints)

Constraints to be applied on double

remarks

Since 2.6.0

FalsyType

FalsyType: FalsyValue
deprecated

Switch to FalsyValue instead

remarks

Since 1.26.0

FalsyValue

FalsyValue<TConstraints>: false | null | 0 | "" | typeof NaN | undefined | (TConstraints extends { withBigInt: true } ? 0n : never)

Typing for values generated by falsy

remarks

Since 2.2.0

Type parameters

Float32ArrayConstraints

Float32ArrayConstraints: { maxLength?: number; minLength?: number } & FloatNextConstraints

Constraints to be applied on float32Array

remarks

Since 2.9.0

Float64ArrayConstraints

Float64ArrayConstraints: { maxLength?: number; minLength?: number } & DoubleNextConstraints

Constraints to be applied on float64Array

remarks

Since 2.9.0

FloatConstraints

FloatConstraints: { max?: number; min?: number; next?: false } | ({ next: true } & FloatNextConstraints)

Constraints to be applied on float

remarks

Since 2.6.0

FrequencyContraints

FrequencyContraints: { depthFactor?: number; depthIdentifier?: string; maxDepth?: number; withCrossShrink?: boolean }

Constraints to be applied on frequency

remarks

Since 2.14.0

Type declaration

  • Optional depthFactor?: number

    While going deeper and deeper within a recursive structure (see letrec), this factor will be used to increase the probability to generate instances of the first passed arbitrary.

    Example of values: 0.1 (small impact as depth increases), 0.5, 1 (huge impact as depth increases).

    Warning: First arbitrary will not be used if its weight is set to zero.

    remarks

    Since 2.14.0

  • Optional depthIdentifier?: string

    Depth identifier can be used to share the current depth between several instances.

    By default, if not specified, each instance of frequency will have its own depth. In other words: you can have depth=1 in one while you have depth=100 in another one.

    remarks

    Since 2.14.0

  • Optional maxDepth?: number

    Maximal authorized depth. Once this depth has been reached only the first arbitrary will be used.

    Warning: Contrary to others, first arbitrary will be used even if its weight is set to zero.

    remarks

    Since 2.14.0

  • Optional withCrossShrink?: boolean

    When set to true, the shrinker of frequency will try to check if the first arbitrary could have been used to discover an issue. It allows to shrink trees.

    Warning: First arbitrary must be the one resulting in the smallest structures for usages in deep tree-like structures.

    Warning: First arbitrary will not be used if its weight is set to zero.

    remarks

    Since 2.14.0

FrequencyValue

FrequencyValue<Ts>: { [ K in keyof Ts]: Ts[K] extends WeightedArbitrary<infer U> ? U : never }[number]

Infer the type of the Arbitrary produced by frequency given the type of the source arbitraries

remarks

Since 2.2.0

Type parameters

GlobalAsyncPropertyHookFunction

GlobalAsyncPropertyHookFunction: (() => Promise<unknown>) | (() => void)

Type of legal hook function that can be used in the global parameter asyncBeforeEach and/or asyncAfterEach

remarks

Since 2.3.0

GlobalParameters

GlobalParameters: Pick<Parameters<unknown>, Exclude<keyof Parameters<unknown>, "path" | "examples">> & { afterEach?: GlobalPropertyHookFunction; asyncAfterEach?: GlobalAsyncPropertyHookFunction; asyncBeforeEach?: GlobalAsyncPropertyHookFunction; beforeEach?: GlobalPropertyHookFunction }

Type describing the global overrides

remarks

Since 1.18.0

GlobalPropertyHookFunction

GlobalPropertyHookFunction: () => void

Type declaration

    • (): void
    • Type of legal hook function that can be used in the global parameter beforeEach and/or afterEach

      remarks

      Since 2.3.0

      Returns void

IntArrayConstraints

IntArrayConstraints: { max?: number; maxLength?: number; min?: number; minLength?: number }

Constraints to be applied on typed arrays for integer values

remarks

Since 2.9.0

Type declaration

  • Optional max?: number

    Upper bound for the generated int (included)

    defaultvalue

    highest possible value for this type

    remarks

    Since 2.9.0

  • Optional maxLength?: number

    Upper bound of the generated array size

    remarks

    Since 2.9.0

  • Optional min?: number

    Lower bound for the generated int (included)

    defaultvalue

    smallest possible value for this type

    remarks

    Since 2.9.0

  • Optional minLength?: number

    Lower bound of the generated array size

    remarks

    Since 2.9.0

JsonValue

JsonValue: boolean | number | string | null | JsonArray | JsonObject

Typings for a Json value

remarks

Since 2.20.0

Memo

Memo<T>: (maxDepth?: number) => Arbitrary<T>

Type parameters

  • T

Type declaration

    • Output type for memo

      remarks

      Since 1.16.0

      Parameters

      • Optional maxDepth: number

      Returns Arbitrary<T>

ModelRunAsyncSetup

ModelRunAsyncSetup<Model, Real>: () => Promise<{ model: Model; real: Real }>

Type parameters

  • Model

  • Real

Type declaration

    • (): Promise<{ model: Model; real: Real }>
    • Asynchronous definition of model and real

      remarks

      Since 2.2.0

      Returns Promise<{ model: Model; real: Real }>

ModelRunSetup

ModelRunSetup<Model, Real>: () => { model: Model; real: Real }

Type parameters

  • Model

  • Real

Type declaration

    • (): { model: Model; real: Real }
    • Synchronous definition of model and real

      remarks

      Since 2.2.0

      Returns { model: Model; real: Real }

      • model: Model
      • real: Real

OneOfConstraints

OneOfConstraints: { depthFactor?: number; depthIdentifier?: string; maxDepth?: number; withCrossShrink?: boolean }

Constraints to be applied on oneof

remarks

Since 2.14.0

Type declaration

  • Optional depthFactor?: number

    While going deeper and deeper within a recursive structure (see letrec), this factor will be used to increase the probability to generate instances of the first passed arbitrary.

    Example of values: 0.1 (small impact as depth increases), 0.5, 1 (huge impact as depth increases).

    remarks

    Since 2.14.0

  • Optional depthIdentifier?: string

    Depth identifier can be used to share the current depth between several instances.

    By default, if not specified, each instance of oneof will have its own depth. In other words: you can have depth=1 in one while you have depth=100 in another one.

    remarks

    Since 2.14.0

  • Optional maxDepth?: number

    Maximal authorized depth. Once this depth has been reached only the first arbitrary will be used.

    remarks

    Since 2.14.0

  • Optional withCrossShrink?: boolean

    When set to true, the shrinker of oneof will try to check if the first arbitrary could have been used to discover an issue. It allows to shrink trees.

    Warning: First arbitrary must be the one resulting in the smallest structures for usages in deep tree-like structures.

    remarks

    Since 2.14.0

OneOfValue

OneOfValue<Ts>: { [ K in keyof Ts]: Ts[K] extends Arbitrary<infer U> ? U : never }[number]

Infer the type of the Arbitrary produced by oneof given the type of the source arbitraries

remarks

Since 2.2.0

Type parameters

PropertyHookFunction

PropertyHookFunction: (globalHookFunction: GlobalPropertyHookFunction) => void

Type declaration

PureRandom

PureRandom: PureRandRandomGenerator | LegacyPureRandRandomGenerator

The minimal API for a random generator as requested by fast-check. The most important point being that the generator HAS TO BE pure. In other words, it has to expose methods to compute a random value while not impacting itself (see next/jump).

deprecated

Temporary helper that will disappear in next major release. Prefer referencing directly RandomGenerator from RandomGenerator.

remarks

Since 2.17.0

RandomType

RandomType: "mersenne" | "congruential" | "congruential32" | "xorshift128plus" | "xoroshiro128plus"

Random generators automatically recognized by the framework without having to pass a builder function

remarks

Since 2.2.0

RecordConstraints

RecordConstraints<T>: { requiredKeys?: T[] } | { withDeletedKeys?: boolean }

Constraints to be applied on record

remarks

Since 0.0.12

Type parameters

  • T = unknown

RecordValue

RecordValue<T, TConstraints>: TConstraints extends { requiredKeys: any[]; withDeletedKeys: boolean } ? never : TConstraints extends { withDeletedKeys: true } ? Partial<T> : TConstraints extends { requiredKeys: infer TKeys[] } ? Partial<T> & Pick<T, TKeys & keyof T> : T

Infer the type of the Arbitrary produced by record given the type of the source arbitrary and constraints to be applied

remarks

Since 2.2.0

Type parameters

  • T

  • TConstraints = {}

RunDetails

Post-run details produced by check

A failing property can easily detected by checking the failed flag of this structure

remarks

Since 0.0.7

Type parameters

  • Ts

SchedulerSequenceItem

SchedulerSequenceItem<TMetaData>: { label: string; metadata?: TMetaData; builder: any } | (() => Promise<any>)

Define an item to be passed to scheduleSequence

remarks

Since 1.20.0

Type parameters

  • TMetaData = unknown

WithAsyncToStringMethod

WithAsyncToStringMethod: { [asyncToStringMethod]: any }

Interface to implement for asyncToStringMethod

remarks

Since 2.17.0

Type declaration

  • [asyncToStringMethod]:function
    • [asyncToStringMethod](): Promise<string>

WithToStringMethod

WithToStringMethod: { [toStringMethod]: any }

Interface to implement for toStringMethod

remarks

Since 2.17.0

Type declaration

Variables

__commitHash

__commitHash: string = ...

Commit hash of the current code (eg.: COMMIT_HASH)

remarks

Since 2.7.0

__type

__type: string = ...

Type of module (commonjs or module)

remarks

Since 1.22.0

__version

__version: string = ...

Version of fast-check used by your project (eg.: PACKAGE_VERSION)

remarks

Since 1.22.0

asyncToStringMethod

asyncToStringMethod: typeof asyncToStringMethod = ...

Use this symbol to define a custom serializer for your instances. Serializer must be a function returning a promise of string (see WithAsyncToStringMethod).

Please note that:

  1. It will only be useful for asynchronous properties.
  2. It has to return barely instantly.
remarks

Since 2.17.0

cloneMethod

cloneMethod: typeof cloneMethod = ...

Generated instances having a method [cloneMethod] will be automatically cloned whenever necessary

This is pretty useful for statefull generated values. For instance, whenever you use a Stream you directly impact it. Implementing [cloneMethod] on the generated Stream would force the framework to clone it whenever it has to re-use it (mainly required for chrinking process)

remarks

Since 1.8.0

toStringMethod

toStringMethod: typeof toStringMethod = ...

Use this symbol to define a custom serializer for your instances. Serializer must be a function returning a string (see WithToStringMethod).

remarks

Since 2.17.0

Functions

anything

  • For any type of values

    You may use sample to preview the values that will be generated

    example
    null, undefined, 42, 6.5, 'Hello', {}, {k: [{}, 1, 2]}
    
    remarks

    Since 0.0.7

    Returns Arbitrary<unknown>

  • For any type of values following the constraints defined by settings

    You may use sample to preview the values that will be generated

    example
    null, undefined, 42, 6.5, 'Hello', {}, {k: [{}, 1, 2]}
    
    example
    // Using custom settings
    fc.anything({
    key: fc.char(),
    values: [fc.integer(10,20), fc.constant(42)],
    maxDepth: 2
    });
    // Can build entries such as:
    // - 19
    // - [{"2":12,"k":15,"A":42}]
    // - {"4":[19,13,14,14,42,11,20,11],"6":42,"7":16,"L":10,"'":[20,11],"e":[42,20,42,14,13,17]}
    // - [42,42,42]...
    remarks

    Since 0.0.7

    Parameters

    Returns Arbitrary<unknown>

array

  • For arrays of values coming from arb

    remarks

    Since 0.0.1

    Type parameters

    • T

    Parameters

    • arb: Arbitrary<T>

      Arbitrary used to generate the values inside the array

    Returns Arbitrary<T[]>

  • For arrays of values coming from arb having an upper bound size

    deprecated

    Superceded by fc.array(arb, {maxLength}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 0.0.1

    Type parameters

    • T

    Parameters

    • arb: Arbitrary<T>

      Arbitrary used to generate the values inside the array

    • maxLength: number

      Upper bound of the generated array size

    Returns Arbitrary<T[]>

  • For arrays of values coming from arb having lower and upper bound size

    deprecated

    Superceded by fc.array(arb, {minLength, maxLength}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 0.0.7

    Type parameters

    • T

    Parameters

    • arb: Arbitrary<T>

      Arbitrary used to generate the values inside the array

    • minLength: number

      Lower bound of the generated array size

    • maxLength: number

      Upper bound of the generated array size

    Returns Arbitrary<T[]>

  • For arrays of values coming from arb having lower and upper bound size

    remarks

    Since 2.4.0

    Type parameters

    • T

    Parameters

    • arb: Arbitrary<T>

      Arbitrary used to generate the values inside the array

    • constraints: ArrayConstraints

      Constraints to apply when building instances

    Returns Arbitrary<T[]>

ascii

asciiString

assert

  • Run the property, throw in case of failure

    It can be called directly from describe/it blocks of Mocha. It does not return anything in case of success.

    WARNING: Has to be awaited

    remarks

    Since 0.0.7

    Type parameters

    • Ts

    Parameters

    • property: IAsyncProperty<Ts>

      Asynchronous property to be checked

    • Optional params: Parameters<Ts>

      Optional parameters to customize the execution

    Returns Promise<void>

  • Run the property, throw in case of failure

    It can be called directly from describe/it blocks of Mocha. It does not return anything in case of success.

    remarks

    Since 0.0.1

    Type parameters

    • Ts

    Parameters

    • property: IProperty<Ts>

      Synchronous property to be checked

    • Optional params: Parameters<Ts>

      Optional parameters to customize the execution

    Returns void

  • Run the property, throw in case of failure

    It can be called directly from describe/it blocks of Mocha. It does not return anything in case of success.

    WARNING: Has to be awaited if the property is asynchronous

    remarks

    Since 0.0.7

    Type parameters

    • Ts

    Parameters

    • property: IRawProperty<Ts, boolean>

      Property to be checked

    • Optional params: Parameters<Ts>

      Optional parameters to customize the execution

    Returns Promise<void> | void

asyncDefaultReportMessage

  • asyncDefaultReportMessage<Ts>(out: never & never & never & (RunDetailsSuccess<Ts> & { failed: false })): Promise<undefined>
  • asyncDefaultReportMessage<Ts>(out: RunDetails<Ts> & { failed: true }): Promise<string>
  • asyncDefaultReportMessage<Ts>(out: RunDetails<Ts>): Promise<string | undefined>

asyncModelRun

  • Run asynchronous commands over a Model and the Real system

    Throw in case of inconsistency

    remarks

    Since 1.5.0

    Type parameters

    • Model: object

    • Real

    • CheckAsync: boolean

    • InitialModel: object

    Parameters

    Returns Promise<void>

asyncProperty

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    Parameters

    • arb0: Arbitrary<T0>
    • predicate: (t0: T0) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0): Promise<boolean | void>
        • Parameters

          • t0: T0

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • predicate: (t0: T0, t1: T1) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • predicate: (t0: T0, t1: T1, t2: T2) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    • T14

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • arb14: Arbitrary<T14>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13
          • t14: T14

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    • T14

    • T15

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • arb14: Arbitrary<T14>
    • arb15: Arbitrary<T15>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13
          • t14: T14
          • t15: T15

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    • T14

    • T15

    • T16

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • arb14: Arbitrary<T14>
    • arb15: Arbitrary<T15>
    • arb16: Arbitrary<T16>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13
          • t14: T14
          • t15: T15
          • t16: T16

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    • T14

    • T15

    • T16

    • T17

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • arb14: Arbitrary<T14>
    • arb15: Arbitrary<T15>
    • arb16: Arbitrary<T16>
    • arb17: Arbitrary<T17>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13
          • t14: T14
          • t15: T15
          • t16: T16
          • t17: T17

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    • T14

    • T15

    • T16

    • T17

    • T18

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • arb14: Arbitrary<T14>
    • arb15: Arbitrary<T15>
    • arb16: Arbitrary<T16>
    • arb17: Arbitrary<T17>
    • arb18: Arbitrary<T18>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13
          • t14: T14
          • t15: T15
          • t16: T16
          • t17: T17
          • t18: T18

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    • T14

    • T15

    • T16

    • T17

    • T18

    • T19

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • arb14: Arbitrary<T14>
    • arb15: Arbitrary<T15>
    • arb16: Arbitrary<T16>
    • arb17: Arbitrary<T17>
    • arb18: Arbitrary<T18>
    • arb19: Arbitrary<T19>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18, t19: T19) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18, t19: T19): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13
          • t14: T14
          • t15: T15
          • t16: T16
          • t17: T17
          • t18: T18
          • t19: T19

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    • T14

    • T15

    • T16

    • T17

    • T18

    • T19

    • T20

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • arb14: Arbitrary<T14>
    • arb15: Arbitrary<T15>
    • arb16: Arbitrary<T16>
    • arb17: Arbitrary<T17>
    • arb18: Arbitrary<T18>
    • arb19: Arbitrary<T19>
    • arb20: Arbitrary<T20>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18, t19: T19, t20: T20) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18, t19: T19, t20: T20): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13
          • t14: T14
          • t15: T15
          • t16: T16
          • t17: T17
          • t18: T18
          • t19: T19
          • t20: T20

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20]>

  • Instantiate a new {@link fast-check#IAsyncProperty}

    remarks

    Since 0.0.7

    Type parameters

    • T0

    • T1

    • T2

    • T3

    • T4

    • T5

    • T6

    • T7

    • T8

    • T9

    • T10

    • T11

    • T12

    • T13

    • T14

    • T15

    • T16

    • T17

    • T18

    • T19

    • T20

    • T21

    Parameters

    • arb0: Arbitrary<T0>
    • arb1: Arbitrary<T1>
    • arb2: Arbitrary<T2>
    • arb3: Arbitrary<T3>
    • arb4: Arbitrary<T4>
    • arb5: Arbitrary<T5>
    • arb6: Arbitrary<T6>
    • arb7: Arbitrary<T7>
    • arb8: Arbitrary<T8>
    • arb9: Arbitrary<T9>
    • arb10: Arbitrary<T10>
    • arb11: Arbitrary<T11>
    • arb12: Arbitrary<T12>
    • arb13: Arbitrary<T13>
    • arb14: Arbitrary<T14>
    • arb15: Arbitrary<T15>
    • arb16: Arbitrary<T16>
    • arb17: Arbitrary<T17>
    • arb18: Arbitrary<T18>
    • arb19: Arbitrary<T19>
    • arb20: Arbitrary<T20>
    • arb21: Arbitrary<T21>
    • predicate: (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18, t19: T19, t20: T20, t21: T21) => Promise<boolean | void>

      Assess the success of the property. Would be considered falsy if it throws or if its output evaluates to false

        • (t0: T0, t1: T1, t2: T2, t3: T3, t4: T4, t5: T5, t6: T6, t7: T7, t8: T8, t9: T9, t10: T10, t11: T11, t12: T12, t13: T13, t14: T14, t15: T15, t16: T16, t17: T17, t18: T18, t19: T19, t20: T20, t21: T21): Promise<boolean | void>
        • Parameters

          • t0: T0
          • t1: T1
          • t2: T2
          • t3: T3
          • t4: T4
          • t5: T5
          • t6: T6
          • t7: T7
          • t8: T8
          • t9: T9
          • t10: T10
          • t11: T11
          • t12: T12
          • t13: T13
          • t14: T14
          • t15: T15
          • t16: T16
          • t17: T17
          • t18: T18
          • t19: T19
          • t20: T20
          • t21: T21

          Returns Promise<boolean | void>

    Returns IAsyncPropertyWithHooks<[T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21]>

asyncStringify

  • asyncStringify<Ts>(value: Ts): Promise<string>
  • Convert any value to its fast-check string representation

    This asynchronous version is also able to dig into the status of Promise

    remarks

    Since 2.17.0

    Type parameters

    • Ts

    Parameters

    • value: Ts

      Value to be converted into a string

    Returns Promise<string>

base64

base64String

  • For base64 strings

    A base64 string will always have a length multiple of 4 (padded with =)

    remarks

    Since 0.0.1

    Returns Arbitrary<string>

  • For base64 strings

    A base64 string will always have a length multiple of 4 (padded with =)

    deprecated

    Superceded by fc.base64String({maxLength}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 0.0.1

    Parameters

    • maxLength: number

      Upper bound of the generated string length

    Returns Arbitrary<string>

  • For base64 strings

    A base64 string will always have a length multiple of 4 (padded with =)

    deprecated

    Superceded by fc.base64String({minLength, maxLength}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 0.0.11

    Parameters

    • minLength: number

      Lower bound of the generated string length

    • maxLength: number

      Upper bound of the generated string length

    Returns Arbitrary<string>

  • For base64 strings

    A base64 string will always have a length multiple of 4 (padded with =)

    remarks

    Since 2.4.0

    Parameters

    Returns Arbitrary<string>

bigInt

bigIntN

bigUint

bigUintN

boolean

char

char16bits

  • For single characters - all values in 0x0000-0xffff can be generated

    WARNING:

    Some generated characters might appear invalid regarding UCS-2 and UTF-16 encoding. Indeed values within 0xd800 and 0xdfff constitute surrogate pair characters and are illegal without their paired character.

    remarks

    Since 0.0.11

    Returns Arbitrary<string>

check

  • Run the property, do not throw contrary to assert

    WARNING: Has to be awaited

    remarks

    Since 0.0.7

    Type parameters

    • Ts

    Parameters

    • property: IAsyncProperty<Ts>

      Asynchronous property to be checked

    • Optional params: Parameters<Ts>

      Optional parameters to customize the execution

    Returns Promise<RunDetails<Ts>>

    Test status and other useful details

  • Run the property, do not throw contrary to assert

    remarks

    Since 0.0.1

    Type parameters

    • Ts

    Parameters

    • property: IProperty<Ts>

      Synchronous property to be checked

    • Optional params: Parameters<Ts>

      Optional parameters to customize the execution

    Returns RunDetails<Ts>

    Test status and other useful details

  • Run the property, do not throw contrary to assert

    WARNING: Has to be awaited if the property is asynchronous

    remarks

    Since 0.0.7

    Type parameters

    • Ts

    Parameters

    • property: IRawProperty<Ts, boolean>

      Property to be checked

    • Optional params: Parameters<Ts>

      Optional parameters to customize the execution

    Returns Promise<RunDetails<Ts>> | RunDetails<Ts>

    Test status and other useful details

clone

  • Clone the values generated by arb in order to produce fully equal values (might not be equal in terms of === or ==)

    remarks

    Since 2.5.0

    Type parameters

    • T

    • N: number

    Parameters

    • arb: Arbitrary<T>

      Source arbitrary

    • numValues: N

      Number of values to produce

    Returns Arbitrary<CloneValue<T, N>>

cloneIfNeeded

  • cloneIfNeeded<T>(instance: T): T
  • Clone an instance if needed

    remarks

    Since 2.15.0

    Type parameters

    • T

    Parameters

    • instance: T

    Returns T

Const clonedConstant

commands

compareBooleanFunc

  • compareBooleanFunc<T>(): Arbitrary<(a: T, b: T) => boolean>
  • For comparison boolean functions

    A comparison boolean function returns:

    • true whenever a < b
    • false otherwise (ie. a = b or a > b)
    remarks

    Since 1.6.0

    Type parameters

    • T

    Returns Arbitrary<(a: T, b: T) => boolean>

compareFunc

  • compareFunc<T>(): Arbitrary<(a: T, b: T) => number>
  • For comparison functions

    A comparison function returns:

    • negative value whenever a < b
    • positive value whenever a > b
    • zero whenever a and b are equivalent

    Comparison functions are transitive: a < b and b < c => a < c

    They also satisfy: a < b <=> b > a and a = b <=> b = a

    remarks

    Since 1.6.0

    Type parameters

    • T

    Returns Arbitrary<(a: T, b: T) => number>

configureGlobal

  • Define global parameters that will be used by all the runners

    example
    fc.configureGlobal({ numRuns: 10 });
    //...
    fc.assert(
    fc.property(
    fc.nat(), fc.nat(),
    (a, b) => a + b === b + a
    ), { seed: 42 }
    ) // equivalent to { numRuns: 10, seed: 42 }
    remarks

    Since 1.18.0

    Parameters

    Returns void

constant

constantFrom

  • constantFrom<T>(...values: T[]): Arbitrary<T>
  • constantFrom<TArgs>(...values: TArgs): Arbitrary<TArgs[number]>
  • For one ...values values - all equiprobable

    WARNING: It expects at least one value, otherwise it should throw

    remarks

    Since 0.0.12

    Type parameters

    • T = never

    Parameters

    • Rest ...values: T[]

      Constant values to be produced (all values shrink to the first one)

    Returns Arbitrary<T>

  • For one ...values values - all equiprobable

    WARNING: It expects at least one value, otherwise it should throw

    remarks

    Since 0.0.12

    Type parameters

    • TArgs: any[] | [any]

    Parameters

    • Rest ...values: TArgs

      Constant values to be produced (all values shrink to the first one)

    Returns Arbitrary<TArgs[number]>

context

convertFromNext

convertFromNextWithShrunkOnce

convertToNext

date

  • date(constraints?: { max?: Date; min?: Date }): Arbitrary<Date>
  • For date between constraints.min or new Date(-8640000000000000) (included) and constraints.max or new Date(8640000000000000) (included)

    remarks

    Since 1.17.0

    Parameters

    • Optional constraints: { max?: Date; min?: Date }

      Constraints to apply when building instances

      • Optional max?: Date
      • Optional min?: Date

    Returns Arbitrary<Date>

Const dedup

defaultReportMessage

  • defaultReportMessage<Ts>(out: never & never & never & (RunDetailsSuccess<Ts> & { failed: false })): undefined
  • defaultReportMessage<Ts>(out: RunDetails<Ts> & { failed: true }): string
  • defaultReportMessage<Ts>(out: RunDetails<Ts>): string | undefined

dictionary

  • For dictionaries with keys produced by keyArb and values from valueArb

    remarks

    Since 1.0.0

    Type parameters

    • T

    Parameters

    • keyArb: Arbitrary<string>

      Arbitrary used to generate the keys of the object

    • valueArb: Arbitrary<T>

      Arbitrary used to generate the values of the object

    Returns Arbitrary<Record<string, T>>

domain

double

  • For floating point numbers between 0.0 (included) and 1.0 (excluded) - accuracy of 1 / 2**53

    remarks

    Since 0.0.6

    Returns Arbitrary<number>

  • For floating point numbers between 0.0 (included) and max (excluded) - accuracy of max / 2**53

    deprecated

    Superceded by fc.double({max}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 1.0.0

    Parameters

    • max: number

      Upper bound of the generated floating point

    Returns Arbitrary<number>

  • For floating point numbers between min (included) and max (excluded) - accuracy of (max - min) / 2**53

    remarks

    You may prefer to use fc.double({min, max}) instead.

    remarks

    Since 1.0.0

    Parameters

    • min: number

      Lower bound of the generated floating point

    • max: number

      Upper bound of the generated floating point

    Returns Arbitrary<number>

  • For floating point numbers in range defined by constraints - accuracy of (max - min) / 2**53

    remarks

    Since 2.6.0

    Parameters

    Returns Arbitrary<number>

emailAddress

falsy

  • For falsy values:

    • ''
    • 0
    • NaN
    • false
    • null
    • undefined
    • 0n (whenever withBigInt: true)
    remarks

    Since 1.26.0

    Type parameters

    Parameters

    • Optional constraints: TConstraints

      Constraints to apply when building instances

    Returns Arbitrary<FalsyValue<TConstraints>>

float

  • For floating point numbers between 0.0 (included) and 1.0 (excluded) - accuracy of 1 / 2**24

    remarks

    Since 0.0.6

    Returns Arbitrary<number>

  • For floating point numbers between 0.0 (included) and max (excluded) - accuracy of max / 2**24

    deprecated

    Superceded by fc.float({max}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 1.0.0

    Parameters

    • max: number

      Upper bound of the generated floating point

    Returns Arbitrary<number>

  • For floating point numbers between min (included) and max (excluded) - accuracy of (max - min) / 2**24

    remarks

    You may prefer to use fc.float({min, max}) instead.

    remarks

    Since 1.0.0

    Parameters

    • min: number

      Lower bound of the generated floating point

    • max: number

      Upper bound of the generated floating point

    Returns Arbitrary<number>

  • For floating point numbers in range defined by constraints - accuracy of (max - min) / 2**24

    remarks

    Since 2.6.0

    Parameters

    Returns Arbitrary<number>

float32Array

float64Array

frequency

  • For one of the values generated by ...warbs - the probability of selecting the ith warb is of warb[i].weight / sum(warb[j].weight)

    WARNING: It expects at least one (Arbitrary, weight)

    remarks

    Since 0.0.7

    Type parameters

    Parameters

    • Rest ...warbs: Ts

      (Arbitrary, weight)s that might be called to produce a value

    Returns Arbitrary<FrequencyValue<Ts>>

  • For one of the values generated by ...warbs - the probability of selecting the ith warb is of warb[i].weight / sum(warb[j].weight)

    WARNING: It expects at least one (Arbitrary, weight)

    remarks

    Since 0.0.7

    Type parameters

    Parameters

    • constraints: FrequencyContraints

      Constraints to be applied when generating the values

    • Rest ...warbs: Ts

      (Arbitrary, weight)s that might be called to produce a value

    Returns Arbitrary<FrequencyValue<Ts>>

fullUnicode

fullUnicodeString

func

  • For pure functions

    remarks

    Since 1.6.0

    Type parameters

    • TArgs: any[]

    • TOut

    Parameters

    • arb: Arbitrary<TOut>

      Arbitrary responsible to produce the values

    Returns Arbitrary<(...args: TArgs) => TOut>

genericTuple

  • genericTuple<Ts>(arbs: { [ K in string | number | symbol]: Arbitrary<Ts[K]> }): Arbitrary<Ts>
  • For tuples produced by the provided arbs

    deprecated

    Switch to tuple instead

    remarks

    Since 1.0.0

    Type parameters

    • Ts: unknown[]

    Parameters

    • arbs: { [ K in string | number | symbol]: Arbitrary<Ts[K]> }

      Ordered list of arbitraries

    Returns Arbitrary<Ts>

hasAsyncToStringMethod

hasCloneMethod

hasToStringMethod

hash

  • hash(repr: string): number

hexa

hexaString

infiniteStream

int16Array

int32Array

int8Array

integer

ipV4

ipV4Extended

ipV6

json

jsonObject

  • For any JSON compliant values

    Keys and string values rely on string

    As JSON.parse preserves -0, jsonObject can also have -0 as a value. jsonObject must be seen as: any value that could have been built by doing a JSON.parse on a given string.

    deprecated

    Switch to jsonValue instead

    remarks

    Since 1.2.3

    Returns Arbitrary<JsonValue>

  • For any JSON compliant values with a maximal depth

    Keys and string values rely on string

    As JSON.parse preserves -0, jsonObject can also have -0 as a value. jsonObject must be seen as: any value that could have been built by doing a JSON.parse on a given string.

    deprecated

    Superceded by fc.jsonObject({maxDepth}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 1.2.3

    Parameters

    • maxDepth: number

      Maximal depth of the generated values

    Returns Arbitrary<JsonValue>

  • For any JSON compliant values

    Keys and string values rely on string

    As JSON.parse preserves -0, jsonObject can also have -0 as a value. jsonObject must be seen as: any value that could have been built by doing a JSON.parse on a given string.

    deprecated

    Switch to jsonValue instead

    remarks

    Since 2.5.0

    Parameters

    Returns Arbitrary<JsonValue>

jsonValue

  • For any JSON compliant values

    Keys and string values rely on string

    As JSON.parse preserves -0, jsonValue can also have -0 as a value. jsonValue must be seen as: any value that could have been built by doing a JSON.parse on a given string.

    remarks

    Since 2.20.0

    Parameters

    Returns Arbitrary<JsonValue>

letrec

  • letrec<T>(builder: (tie: (key: string) => Arbitrary<unknown>) => { [ K in string | number | symbol]: Arbitrary<T[K]> }): { [ K in keyof T]: Arbitrary<T[K]> }
  • For mutually recursive types

    example
    const { tree } = fc.letrec(tie => ({
    tree: fc.oneof({depthFactor: 0.5}, tie('leaf'), tie('node')),
    node: fc.tuple(tie('tree'), tie('tree')),
    leaf: fc.nat()
    }));
    // tree is 50% of node, 50% of leaf
    // the ratio goes in favor of leaves as we go deeper in the tree (thanks to depthFactor)
    remarks

    Since 1.16.0

    Type parameters

    • T

    Parameters

    • builder: (tie: (key: string) => Arbitrary<unknown>) => { [ K in string | number | symbol]: Arbitrary<T[K]> }

      Arbitraries builder based on themselves (through tie)

        • (tie: (key: string) => Arbitrary<unknown>): { [ K in string | number | symbol]: Arbitrary<T[K]> }
        • Parameters

          Returns { [ K in string | number | symbol]: Arbitrary<T[K]> }

    Returns { [ K in keyof T]: Arbitrary<T[K]> }

lorem

  • For lorem ipsum strings of words

    remarks

    Since 0.0.1

    Returns Arbitrary<string>

  • For lorem ipsum string of words with maximal number of words

    deprecated

    Superceded by fc.lorem({maxCount}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 0.0.1

    Parameters

    • maxWordsCount: number

      Upper bound of the number of words allowed

    Returns Arbitrary<string>

  • For lorem ipsum string of words or sentences with maximal number of words or sentences

    deprecated

    Superceded by fc.lorem({maxCount, mode}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 0.0.1

    Parameters

    • maxWordsCount: number

      Upper bound of the number of words/sentences allowed

    • sentencesMode: boolean

      If enabled, multiple sentences might be generated

    Returns Arbitrary<string>

  • For lorem ipsum string of words or sentences with maximal number of words or sentences

    remarks

    Since 2.5.0

    Parameters

    • constraints: LoremConstraints

      Constraints to be applied onto the generated value

    Returns Arbitrary<string>

mapToConstant

  • mapToConstant<T>(...entries: { num: number; build: any }[]): Arbitrary<T>
  • Generate non-contiguous ranges of values by mapping integer values to constant

    example
    // generate alphanumeric values (a-z0-9)
    mapToConstant(
    { num: 26, build: v => String.fromCharCode(v + 0x61) },
    { num: 10, build: v => String.fromCharCode(v + 0x30) },
    )
    remarks

    Since 1.14.0

    Type parameters

    • T

    Parameters

    • Rest ...entries: { num: number; build: any }[]

    Returns Arbitrary<T>

maxSafeInteger

maxSafeNat

memo

  • For mutually recursive types

    example
    // tree is 1 / 3 of node, 2 / 3 of leaf
    const tree: fc.Memo<Tree> = fc.memo(n => fc.oneof(node(n), leaf(), leaf()));
    const node: fc.Memo<Tree> = fc.memo(n => {
    if (n <= 1) return fc.record({ left: leaf(), right: leaf() });
    return fc.record({ left: tree(), right: tree() }); // tree() is equivalent to tree(n-1)
    });
    const leaf = fc.nat;
    remarks

    Since 1.16.0

    Type parameters

    • T

    Parameters

    • builder: (maxDepth: number) => Arbitrary<T>

      Arbitrary builder taken the maximal depth allowed as input (parameter n)

    Returns Memo<T>

mixedCase

  • Randomly switch the case of characters generated by stringArb (upper/lower)

    WARNING: Require bigint support. Under-the-hood the arbitrary relies on bigint to compute the flags that should be toggled or not.

    remarks

    Since 1.17.0

    Parameters

    • stringArb: Arbitrary<string>

      Arbitrary able to build string values

    • Optional constraints: MixedCaseConstraints

      Constraints to be applied when computing upper/lower case version

    Returns Arbitrary<string>

modelRun

  • modelRun<Model, Real, InitialModel>(s: ModelRunSetup<InitialModel, Real>, cmds: Iterable<Command<Model, Real>>): void
  • Run synchronous commands over a Model and the Real system

    Throw in case of inconsistency

    remarks

    Since 1.5.0

    Type parameters

    • Model: object

    • Real

    • InitialModel: object

    Parameters

    • s: ModelRunSetup<InitialModel, Real>

      Initial state provider

    • cmds: Iterable<Command<Model, Real>>

      Synchronous commands to be executed

    Returns void

nat

object

  • For any objects

    You may use sample to preview the values that will be generated

    example
    {}, {k: [{}, 1, 2]}
    
    remarks

    Since 0.0.7

    Returns Arbitrary<Record<string, unknown>>

  • For any objects following the constraints defined by settings

    You may use sample to preview the values that will be generated

    example
    {}, {k: [{}, 1, 2]}
    
    remarks

    Since 0.0.7

    Parameters

    Returns Arbitrary<Record<string, unknown>>

oneof

  • For one of the values generated by ...arbs - with all ...arbs equiprobable

    WARNING: It expects at least one arbitrary

    remarks

    Since 0.0.1

    Type parameters

    Parameters

    • Rest ...arbs: Ts

      Arbitraries that might be called to produce a value

    Returns Arbitrary<OneOfValue<Ts>>

  • For one of the values generated by ...arbs - with all ...arbs equiprobable

    WARNING: It expects at least one arbitrary

    remarks

    Since 2.14.0

    Type parameters

    Parameters

    • constraints: OneOfConstraints

      Constraints to be applied when generating the values

    • Rest ...arbs: Ts

      Arbitraries that might be called to produce a value

    Returns Arbitrary<OneOfValue<Ts>>

option

  • For either null or a value coming from arb

    remarks

    Since 0.0.6

    Type parameters

    • T

    Parameters

    • arb: Arbitrary<T>

      Arbitrary that will be called to generate a non null value

    Returns Arbitrary<T | null>

  • For either null or a value coming from arb with custom frequency

    deprecated

    Superceded by fc.option(arb, {freq}) - see #992. Ease the migration with our codemod script.

    remarks

    Since 0.0.6

    Type parameters

    • T

    Parameters

    • arb: Arbitrary<T>

      Arbitrary that will be called to generate a non null value

    • freq: number

      The probability to build a null value is of 1 / freq

    Returns Arbitrary<T | null>

  • For either nil or a value coming from arb with custom frequency

    remarks

    Since 1.17.0

    Type parameters

    • T

    • TNil = null

    Parameters

    • arb: Arbitrary<T>

      Arbitrary that will be called to generate a non nil value

    • constraints: OptionConstraints<TNil>

      Constraints on the option

    Returns Arbitrary<T | TNil>

pre

  • pre(expectTruthy: boolean): void
  • Add pre-condition checks inside a property execution

    remarks

    Since 1.3.0

    Parameters

    • expectTruthy: boolean

      cancel the run whenever this value is falsy

    Returns void

property