Skip to main content

Function: assert()

Call Signature

assert<Ts>(property, params?): Promise<void>

Defined in: packages/fast-check/src/check/runner/Runner.ts:152

Run the property, throw in case of failure

It can be called directly from describe/it blocks of Mocha. No meaningful results are produced in case of success.

WARNING: Has to be awaited

Type Parameters

Type Parameter
Ts

Parameters

ParameterTypeDescription
propertyIAsyncProperty<Ts>Asynchronous property to be checked
params?Parameters<Ts>Optional parameters to customize the execution

Returns

Promise<void>

Remarks

Since 0.0.7

Call Signature

assert<Ts>(property, params?): void

Defined in: packages/fast-check/src/check/runner/Runner.ts:165

Run the property, throw in case of failure

It can be called directly from describe/it blocks of Mocha. No meaningful results are produced in case of success.

Type Parameters

Type Parameter
Ts

Parameters

ParameterTypeDescription
propertyIProperty<Ts>Synchronous property to be checked
params?Parameters<Ts>Optional parameters to customize the execution

Returns

void

Remarks

Since 0.0.1

Call Signature

assert<Ts>(property, params?): void | Promise<void>

Defined in: packages/fast-check/src/check/runner/Runner.ts:180

Run the property, throw in case of failure

It can be called directly from describe/it blocks of Mocha. No meaningful results are produced in case of success.

WARNING: Returns a promise to be awaited if the property is asynchronous

Type Parameters

Type Parameter
Ts

Parameters

ParameterTypeDescription
propertyIRawProperty<Ts>Synchronous or asynchronous property to be checked
params?Parameters<Ts>Optional parameters to customize the execution

Returns

void | Promise<void>

Remarks

Since 0.0.7