Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit 07dade4

Browse files
authored
[integration_test] Fix tests from changes to flutter test machine output (#3480)
1 parent cd358b0 commit 07dade4

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

packages/integration_test/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.2+2
2+
3+
* Fix tests from changes to `flutter test` machine output.
4+
15
## 1.0.2+1
26

37
* Update vm_service constraint

packages/integration_test/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: integration_test
22
description: Runs tests that use the flutter_test API as integration tests.
3-
version: 1.0.2+1
3+
version: 1.0.2+2
44
homepage: https://github.com/flutter/plugins/tree/master/packages/integration_test
55

66
environment:

packages/integration_test/test/binding_fail_test.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,18 @@ Future<Map<String, dynamic>> _runTest(String scriptPath) async {
6161
final String testResults = (await process.stdout
6262
.transform(utf8.decoder)
6363
.expand((String text) => text.split('\n'))
64-
.map((String line) {
64+
.map<dynamic>((String line) {
6565
try {
6666
return jsonDecode(line);
6767
} on FormatException {
6868
// Only interested in test events which are JSON.
6969
}
7070
})
71+
.expand<Map<String, dynamic>>((dynamic json) {
72+
return json is List<dynamic>
73+
? json.cast()
74+
: <Map<String, dynamic>>[json as Map<String, dynamic>];
75+
})
7176
.where((dynamic testEvent) =>
7277
testEvent != null && testEvent['type'] == 'print')
7378
.map((dynamic printEvent) => printEvent['message'] as String)

0 commit comments

Comments
 (0)