test-reporter/reports/dart/test/main_test.dart
Michal Dorner dcaab46b46
Fix dart-json parsing broken by print message
Print message related to suite, instead of a specific test, would break parsing - it would expect test object to be present in dictionary but there would be none.
This fix adds necessary check and messages not related to tracked tests will be ignored.
2021-05-13 21:48:55 +02:00

29 lines
528 B
Dart

import 'package:darttest/main.dart';
import 'package:test/test.dart';
import 'dart:io';
void main() {
group('Test 1', () {
test('Passing test', () {
expect(1, equals(1));
});
group('Test 1.1', () {
test('Failing test', () {
expect(1, equals(2));
});
test('Exception in target unit', () {
throwError();
});
});
});
group('Test 2', () {
test('Exception in test', () {
throw Exception('Some error');
});
});
print('Hello from the test');
}