Skip to main content

Interface: IAsyncProperty<Ts>

Defined in: packages/fast-check/src/check/property/AsyncProperty.generic.ts:33

Interface for asynchronous property, see IRawProperty

Remarks​

Since 1.19.0

Extends​

Extended by​

Type Parameters​

Type Parameter
Ts

Properties​

runAfterEach​

runAfterEach: () => Promise<void>

Defined in: packages/fast-check/src/check/property/IRawProperty.ts:81

Run after each hook

Returns​

Promise<void>

Remarks​

Since 3.4.0

Inherited from​

IRawProperty.runAfterEach


runBeforeEach​

runBeforeEach: () => Promise<void>

Defined in: packages/fast-check/src/check/property/IRawProperty.ts:75

Run before each hook

Returns​

Promise<void>

Remarks​

Since 3.4.0

Inherited from​

IRawProperty.runBeforeEach

Methods​

generate()​

generate(mrng, runId?): Value<Ts>

Defined in: packages/fast-check/src/check/property/IRawProperty.ts:49

Generate values of type Ts

Parameters​

ParameterTypeDescription
mrngRandomRandom number generator
runId?numberId of the generation, starting at 0 - if set the generation might be biased

Returns​

Value<Ts>

Remarks​

Since 0.0.7 (return type changed in 3.0.0)

Inherited from​

IRawProperty.generate


isAsync()​

isAsync(): true

Defined in: packages/fast-check/src/check/property/IRawProperty.ts:39

Is the property asynchronous?

true in case of asynchronous property, false otherwise

Returns​

true

Remarks​

Since 0.0.7

Inherited from​

IRawProperty.isAsync


run()​

run(v): Promise<PreconditionFailure | PropertyFailure | null>

Defined in: packages/fast-check/src/check/property/IRawProperty.ts:65

Check the predicate for v

Parameters​

ParameterTypeDescription
vTsValue of which we want to check the predicate

Returns​

Promise<PreconditionFailure | PropertyFailure | null>

Remarks​

Since 0.0.7

Inherited from​

IRawProperty.run


shrink()​

shrink(value): Stream<Value<Ts>>

Defined in: packages/fast-check/src/check/property/IRawProperty.ts:58

Shrink value of type Ts

Parameters​

ParameterTypeDescription
valueValue<Ts>The value to be shrunk, it can be context-less

Returns​

Stream<Value<Ts>>

Remarks​

Since 3.0.0

Inherited from​

IRawProperty.shrink