test_report_parser
This library contains an auto-generated Dart Model representing the events emitted by the Dart Tests JSON reporter.
It can be used to parse the Dart Test JSON report into typed Dart objects for further processing.
The model is generated by parsing the json_reporter.md page, which documents the Dart Test JSON reporter output.
Using test_report_parser
Add test_report_parser
to your pubspec dependencies:
dependencies:
test_report_parser:
Basically, call the function parseJsonToEvent(String)
for each line of output from the JSON Test Reporter:
import 'package:test_report_parser/test_report_parser.dart';
void main() {
final event = parseJsonToEvent('{"success":true,"type":"done","time":36361}');
print(event);
if (event is DoneEvent) {
if (event.success) {
print('!!!!!! Tests were successful !!!!!!');
} else {
print('XXXXXX There were failures. XXXXXX');
}
}
}
Check test_report_parser_example.dart for a full example.
See also the generated Dart Model.
Building
This project relies on Dartle to run the build.
If you have dartle
installed, run dartle
at the project root directory to generate the model locally and
execute the tests.
Otherwise, run the build using standard dart
tools as following:
dart pub get
dart dartle.dart generate
dart test
Libraries
- test_report_parser
- This library contains an auto-generated Dart Model representing the events emitted by the Dart Tests JSON reporter.