Class: Conditions<Context, S>
Type parameters
Name | Type |
---|---|
Context | extends ConditionsContextBase <S > |
S | Context ["state" ] |
Hierarchy
Function
↳
Conditions
Callable
Conditions
▸ Conditions(errorMessage?
): ConditionsMethods
<Context
, S
>
Provide custom error message. It will be sent to the client when one of the assertions fail in given chain.
TODO: it would be nice to have an object or error code sent to client additionally. Front-end could then have it pick the message in player's language
Example
test("Wait for your turn!").itsPlayersTurn()
test("Can't perform this action until round 5").its("round").is.aboveEq(5)
Parameters
Name | Type |
---|---|
errorMessage? | string |
Returns
ConditionsMethods
<Context
, S
>
Constructors
constructor
• new Conditions<Context
, S
>(context
, defaultSubjectKey?
)
Type parameters
Name | Type |
---|---|
Context | extends ConditionsContextBase <S > |
S | extends State <Record <string , unknown >, S > = Context ["state" ] |
Parameters
Name | Type |
---|---|
context | Context |
defaultSubjectKey? | keyof Context |
Overrides
Function.constructor