Interface: IRawProperty<Ts, IsAsync>
Defined in: packages/fast-check/src/check/property/IRawProperty.ts:32
Property
A property is the combination of:
- Arbitraries: how to generate the inputs for the algorithm
- Predicate: how to confirm the algorithm succeeded?
Remarks
Since 1.19.0
Extended by
Type Parameters
| Type Parameter | Default type |
|---|---|
Ts | - |
IsAsync extends boolean | boolean |
Properties
runAfterEach
runAfterEach: () =>
IsAsyncextendstrue?Promise<void> :never|IsAsyncextendsfalse?void:never
Defined in: packages/fast-check/src/check/property/IRawProperty.ts:81
Run after each hook
Returns
IsAsync extends true ? Promise<void> : never | IsAsync extends false ? void : never
Remarks
Since 3.4.0
runBeforeEach
runBeforeEach: () =>
IsAsyncextendstrue?Promise<void> :never|IsAsyncextendsfalse?void:never
Defined in: packages/fast-check/src/check/property/IRawProperty.ts:75
Run before each hook
Returns
IsAsync extends true ? Promise<void> : never | IsAsync extends false ? void : never
Remarks
Since 3.4.0
Methods
generate()
generate(
mrng,runId?):Value<Ts>
Defined in: packages/fast-check/src/check/property/IRawProperty.ts:49
Generate values of type Ts
Parameters
| Parameter | Type | Description |
|---|---|---|
mrng | Random | Random number generator |
runId? | number | Id 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)
isAsync()
isAsync():
IsAsync
Defined in: packages/fast-check/src/check/property/IRawProperty.ts:39
Is the property asynchronous?
true in case of asynchronous property, false otherwise
Returns
IsAsync
Remarks
Since 0.0.7
run()
run(
v):IsAsyncextendstrue?Promise<PreconditionFailure|PropertyFailure|null> :never|IsAsyncextendsfalse?PreconditionFailure|PropertyFailure|null:never
Defined in: packages/fast-check/src/check/property/IRawProperty.ts:65
Check the predicate for v
Parameters
| Parameter | Type | Description |
|---|---|---|
v | Ts | Value of which we want to check the predicate |
Returns
IsAsync extends true ? Promise<PreconditionFailure | PropertyFailure | null> : never | IsAsync extends false ? PreconditionFailure | PropertyFailure | null : never
Remarks
Since 0.0.7
shrink()
Defined in: packages/fast-check/src/check/property/IRawProperty.ts:58
Shrink value of type Ts
Parameters
| Parameter | Type | Description |
|---|---|---|
value | Value<Ts> | The value to be shrunk, it can be context-less |
Returns
Remarks
Since 3.0.0