Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 1.27.1-wip

* Bump `test_core` to 0.6.14
* Removed unused `js` dependency

## 1.27.0
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies:

# Use an exact version until the test_api and test_core package are stable.
test_api: 0.7.8
test_core: 0.6.13
test_core: 0.6.14

typed_data: ^1.3.0
web_socket_channel: '>=2.0.0 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.14

* Fix type cast when parsing a `null` hit map.

## 0.6.13

* Require Dart 3.7
Expand Down
11 changes: 10 additions & 1 deletion pkgs/test_core/lib/src/runner/coverage.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@ Future<Coverage> writeCoverage(
await out.flush();
await out.close();
}
return HitMap.parseJson(coverage['coverage'] as List<Map<String, dynamic>>);
return switch (coverage['coverage']) {
// Matching on `List<dynamic>` the runtime type of `List` in JSON is
// never `Map<String, dynamic>`. The `cast` below ensures the runtime type
// is correct for `HitMap.parseJson`.
List<dynamic> hitMapJson => HitMap.parseJson(
hitMapJson.cast<Map<String, dynamic>>(),
),
null => const {},
_ => throw StateError('Invalid coverage data'),
};
}

Future<void> writeCoverageLcov(
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_core
version: 0.6.13
version: 0.6.14
description: A basic library for writing tests and running them on the VM.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core
issue_tracker: https://github.com/dart-lang/test/issues?q=is%3Aissue+is%3Aopen+label%3Apackage%3Atest
Expand Down