Skip to main content

Interface: AsyncCommand<Model, Real, CheckAsync>

Defined in: packages/fast-check/src/check/model/command/AsyncCommand.ts:10

Interface that should be implemented in order to define an asynchronous command

Remarks​

Since 1.5.0

Extends​

  • ICommand<Model, Real, Promise<void>, CheckAsync>

Type Parameters​

Type ParameterDefault type
Model extends object-
Real-
CheckAsync extends booleanfalse

Methods​

check()​

check(m): CheckAsync extends false ? boolean : Promise<boolean>

Defined in: packages/fast-check/src/check/model/command/ICommand.ts:21

Check if the model is in the right state to apply the command

WARNING: does not change the model

Parameters​

ParameterTypeDescription
mReadonly<Model>Model, simplified or schematic representation of real system

Returns​

CheckAsync extends false ? boolean : Promise<boolean>

Remarks​

Since 1.5.0

Inherited from​

ICommand.check


run()​

run(m, r): Promise

Defined in: packages/fast-check/src/check/model/command/ICommand.ts:33

Receive the non-updated model and the real or system under test. Perform the checks post-execution - Throw in case of invalid state. Update the model accordingly

Parameters​

ParameterTypeDescription
mModelModel, simplified or schematic representation of real system
rRealSytem under test

Returns​

Promise

Remarks​

Since 1.5.0

Inherited from​

ICommand.run


toString()​

toString(): string

Defined in: packages/fast-check/src/check/model/command/ICommand.ts:39

Name of the command

Returns​

string

Remarks​

Since 1.5.0

Inherited from​

ICommand.toString