externalEnsure <Actual>
Hierarchy
- Interaction
- Ensure
Index
Methods
staticexternalthat
Creates an interaction to
Ensure
, which verifies if the resolved value of the providedAnswerable
meets the specifiedExpectation
. If not, it immediately throws anAssertionError
.Type parameters
- Actual_Type
Parameters
externalactual: Answerable<Actual_Type>
An
Answerable
describing the actual state of the system.externalexpectation: Expectation<Actual_Type>
An
Expectation
you expect theactual
value to meet
Returns Ensure<Actual_Type>
staticexternaleventually
Creates an interaction to
EnsureEventually
, which verifies if the resolved value of the providedAnswerable
meets the specifiedExpectation
within 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
Answerable
describing the actual state of the system.externalexpectation: Expectation<Actual_Type>
An
Expectation
you expect theactual
value to meet
Returns EnsureEventually<Actual_Type>
externalperformAs
Parameters
externalactor: UsesAbilities & AnswersQuestions & CollectsArtifacts
Returns Promise<void>
externalotherwiseFailWith
Overrides the default
AssertionError
thrown when the actual value does not meet the expectation.Parameters
externaltypeOfRuntimeError: new (message: string, cause?: Error) => RuntimeError
A constructor function producing a subtype of
RuntimeError
to throw, e.g.TestCompromisedError
externaloptionalmessage: string
The message explaining the failure
Returns Interaction
externalinstantiationLocation
Returns the location where this
Activity
was 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
Ensure
verifies if the resolved value of the providedAnswerable
meets the specifiedExpectation
. If not, it throws anAssertionError
.Use
Ensure
to verify the state of the system under test.Basic usage with static values
Composing expectations with
and
Overriding the type of Error thrown upon assertion failure