externalabstractDiscardable
Implemented by
Index
Constructors
Methods
Constructors
externalconstructor
Returns Discardable
Methods
staticexternalisDiscardable
Type parameters
- T
Parameters
externalvalue: T
Returns value is T & Discardable
externalabstractdiscard
Discards the resources associated with this ability.
Returns void | Promise<void>
An interface to be implemented by any
Abilitythat needs to free up the resources it uses, e.g. disconnect from a database.This
Discardable.discardmethod is invoked directly by the actor, and indirectly by the stage:TestRunFinishes, for actors instantiated before SceneStarts - e.g. in a "before all" hookNote that events such as SceneFinishes and
TestRunFinishesare emitted by Serenity/JS test runner adapters, such as@serenity-js/cucumber,@serenity-js/mocha,@serenity-js/jasmine, and so on. Consult their respective readmes to learn how to register them with your test runner of choice.Learn more
AbilityAbilityTypeInitialisable