Property

A property is the combination of:

  • Arbitraries: how to generate the inputs for the algorithm
  • Predicate: how to confirm the algorithm succeeded?

Since 1.19.0

interface IRawProperty<Ts, IsAsync> {
    runAfterEach?: (() => (IsAsync extends true
        ? Promise<void>
        : never) | (IsAsync extends false
        ? void
        : never));
    runBeforeEach?: (() => (IsAsync extends true
        ? Promise<void>
        : never) | (IsAsync extends false
        ? void
        : never));
    generate(mrng: Random, runId?: number): Value<Ts>;
    isAsync(): IsAsync;
    run(v: Ts, dontRunHook?: boolean): (IsAsync extends true
        ? Promise<null | PreconditionFailure | PropertyFailure>
        : never) | (IsAsync extends false
        ? null | PreconditionFailure | PropertyFailure
        : never);
    shrink(value: Value<Ts>): Stream<Value<Ts>>;
}

Type Parameters

  • Ts
  • IsAsync extends boolean = boolean

Hierarchy (view full)

Properties

runAfterEach?: (() => (IsAsync extends true
    ? Promise<void>
    : never) | (IsAsync extends false
    ? void
    : never))

Run after each hook

Since 3.4.0

runBeforeEach?: (() => (IsAsync extends true
    ? Promise<void>
    : never) | (IsAsync extends false
    ? void
    : never))

Run before each hook

Since 3.4.0

Methods