TestEvent class
This is the root class of the protocol. All root-level objects emitted by the JSON reporter will be subclasses of Event.
Imported from https://github.com/dart-lang/test/blob/master/pkgs/test/doc/json_reporter.md
- Implementers
- Annotations
-
- @Freezed(unionKey: 'type', fallbackUnion: 'unknown')
Constructors
- TestEvent.allSuites({required int count, required int time})
-
A single suite count event is emitted once the test runner knows the total
number of suites that will be loaded over the course of the test run.
factory
- TestEvent.debug({required int time, required int suiteID, String? observatory, String? remoteDebugger})
-
A debug event is emitted after (although not necessarily directly after) a SuiteEvent,
and includes information about how to debug that suite.
factory
- TestEvent.done({required bool? success, required int time})
-
An event indicating the result of the entire test run.
factory
- TestEvent.error({required int time, required int testID, required String error, required String stackTrace, required bool isFailure})
-
A ErrorEvent indicates that a test encountered an uncaught error.
factory
-
TestEvent.fromJson(Map<
String, Object?> json) -
Deserialize a TestEvent from a JSON Object
factory
- TestEvent.group(Group group, {required int time})
-
A group event is emitted before any TestStartEvents for tests in a given group.
factory
- TestEvent.print({required int time, required int testID, required String messageType, required String message})
-
A MessageEvent indicates that a test emitted a message that should be
displayed to the user.
factory
- TestEvent.processDone({required int exitCode})
-
The test process finished
factory
- TestEvent.start({required String protocolVersion, required int pid, required int time, String? runnerVersion})
-
A single start event is emitted before any other events.
factory
- TestEvent.suite(Suite suite, {required int time})
-
A suite event is emitted before any GroupEvents for groups in a given test suite.
factory
- TestEvent.testDone({required int time, required int testID, required bool skipped, required TestDoneStatus result})
-
An event emitted when a test completes.
factory
- TestEvent.testStart(Test test, {required int time})
-
An event emitted when a test begins running.
factory
- TestEvent.unknown()
-
When an event that doesn't match any other type was received.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
map<
TResult extends Object?> ({required TResult start(TestEventStart value), required TResult done(TestEventDone value), required TResult allSuites(TestEventAllSuites value), required TResult suite(TestEventSuite value), required TResult group(TestEventGroup value), required TResult testStart(TestEventTestStart value), required TResult testDone(TestEventTestDone value), required TResult print(TestEventMessage value), required TResult error(TestEventTestError value), required TResult debug(TestEventDebug value), required TResult processDone(TestProcessDone value), required TResult unknown(TestEventUnknown value)}) → TResult -
inherited
-
mapOrNull<
TResult extends Object?> ({TResult start(TestEventStart value)?, TResult done(TestEventDone value)?, TResult allSuites(TestEventAllSuites value)?, TResult suite(TestEventSuite value)?, TResult group(TestEventGroup value)?, TResult testStart(TestEventTestStart value)?, TResult testDone(TestEventTestDone value)?, TResult print(TestEventMessage value)?, TResult error(TestEventTestError value)?, TResult debug(TestEventDebug value)?, TResult processDone(TestProcessDone value)?, TResult unknown(TestEventUnknown value)?}) → TResult? -
inherited
-
maybeMap<
TResult extends Object?> ({TResult start(TestEventStart value)?, TResult done(TestEventDone value)?, TResult allSuites(TestEventAllSuites value)?, TResult suite(TestEventSuite value)?, TResult group(TestEventGroup value)?, TResult testStart(TestEventTestStart value)?, TResult testDone(TestEventTestDone value)?, TResult print(TestEventMessage value)?, TResult error(TestEventTestError value)?, TResult debug(TestEventDebug value)?, TResult processDone(TestProcessDone value)?, TResult unknown(TestEventUnknown value)?, required TResult orElse()}) → TResult -
inherited
-
maybeWhen<
TResult extends Object?> ({TResult start(String protocolVersion, int pid, int time, String? runnerVersion)?, TResult done(bool? success, int time)?, TResult allSuites(int count, int time)?, TResult suite(Suite suite, int time)?, TResult group(Group group, int time)?, TResult testStart(Test test, int time)?, TResult testDone(int time, int testID, bool skipped, TestDoneStatus result)?, TResult print(int time, int testID, String messageType, String message)?, TResult error(int time, int testID, String error, String stackTrace, bool isFailure)?, TResult debug(int time, int suiteID, String? observatory, String? remoteDebugger)?, TResult processDone(int exitCode)?, TResult unknown()?, required TResult orElse()}) → TResult -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
when<
TResult extends Object?> ({required TResult start(String protocolVersion, int pid, int time, String? runnerVersion), required TResult done(bool? success, int time), required TResult allSuites(int count, int time), required TResult suite(Suite suite, int time), required TResult group(Group group, int time), required TResult testStart(Test test, int time), required TResult testDone(int time, int testID, bool skipped, TestDoneStatus result), required TResult print(int time, int testID, String messageType, String message), required TResult error(int time, int testID, String error, String stackTrace, bool isFailure), required TResult debug(int time, int suiteID, String? observatory, String? remoteDebugger), required TResult processDone(int exitCode), required TResult unknown()}) → TResult -
inherited
-
whenOrNull<
TResult extends Object?> ({TResult start(String protocolVersion, int pid, int time, String? runnerVersion)?, TResult done(bool? success, int time)?, TResult allSuites(int count, int time)?, TResult suite(Suite suite, int time)?, TResult group(Group group, int time)?, TResult testStart(Test test, int time)?, TResult testDone(int time, int testID, bool skipped, TestDoneStatus result)?, TResult print(int time, int testID, String messageType, String message)?, TResult error(int time, int testID, String error, String stackTrace, bool isFailure)?, TResult debug(int time, int suiteID, String? observatory, String? remoteDebugger)?, TResult processDone(int exitCode)?, TResult unknown()?}) → TResult? -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited