Invoker class

The class responsible for managing the lifecycle of a single local test.

The current invoker is accessible within the zone scope of the running test using Invoker.current. It's used to track asynchronous callbacks and report asynchronous errors.

Properties

closed → bool
Whether the test has been closed.
no setter
hashCode → int
The hash code for this object.
no setterinherited
liveTest → LiveTest
The live test being driven by the invoker.
no setter
onClose → Future<void>
A future that completes once the test has been closed.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

addOutstandingCallback() → void
Tells the invoker that there's a callback running that it should wait for before considering the test successful.
addTearDown(FutureOr callback()) → void
Runs callback after this test completes.
heartbeat() → void
Notifies the invoker that progress is being made.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
printOnFailure(String message) → void
Prints message if and when this test fails.
removeOutstandingCallback() → void
Tells the invoker that a callback declared with addOutstandingCallback is no longer running.
runTearDowns(List<FutureOr<void> Function()> tearDowns) → Future<void>
Run tearDowns in reverse order.
skip([String? message]) → void
Marks the current test as skipped.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

current → Invoker?
The current invoker, or null if none is defined.
no setter

Static Methods

guard<T>(T callback()) → T?
Runs callback in a zone where unhandled errors from LiveTests are caught and dispatched to the appropriate Invoker.