externalEnsure <Actual>
Hierarchy
- Interaction
- Ensure
Index
Methods
staticexternalthat
Creates an interaction to
Ensure, which verifies if the resolved value of the providedAnswerablemeets the specifiedExpectation. If not, it immediately throws anAssertionError.Type parameters
- Actual_Type
Parameters
externalactual: Answerable<Actual_Type>
An
Answerabledescribing the actual state of the system.externalexpectation: Expectation<Actual_Type>
An
Expectationyou expect theactualvalue to meet
Returns Ensure<Actual_Type>
staticexternaleventually
Creates an interaction to
EnsureEventually, which verifies if the resolved value of the providedAnswerablemeets the specifiedExpectationwithin the expected timeframe.If the expectation is not met by the time the timeout expires, the interaction throws an
AssertionError.Type parameters
- Actual_Type
Parameters
externalactual: Answerable<Actual_Type>
An
Answerabledescribing the actual state of the system.externalexpectation: Expectation<Actual_Type>
An
Expectationyou expect theactualvalue to meet
Returns EnsureEventually<Actual_Type>
externalperformAs
Parameters
externalactor: UsesAbilities & AnswersQuestions & CollectsArtifacts
Returns Promise<void>
externalotherwiseFailWith
Overrides the default
AssertionErrorthrown when the actual value does not meet the expectation.Parameters
externaltypeOfRuntimeError: new (message: string, cause?: Error) => RuntimeError
A constructor function producing a subtype of
RuntimeErrorto throw, e.g.TestCompromisedErrorexternaloptionalmessage: string
The message explaining the failure
Returns Interaction
externalinstantiationLocation
Returns the location where this
Activitywas instantiated.Returns FileSystemLocation
externaldescribedBy
Resolves the description of this object in the context of the provided
actor.Parameters
externalactor: AnswersQuestions & UsesAbilities & { name: string }
Returns Promise<string>
externaltoString
Returns a human-readable description of this object.
Returns string
The interaction to
Ensureverifies if the resolved value of the providedAnswerablemeets the specifiedExpectation. If not, it throws anAssertionError.Use
Ensureto verify the state of the system under test.Basic usage with static values
Composing expectations with
andOverriding the type of Error thrown upon assertion failure