diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index 33477a4a4..b5714b71b 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,5 +1,6 @@ ## 1.27.1-wip +* Bump `test_core` to 0.6.14 * Removed unused `js` dependency ## 1.27.0 diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 8b8080c4c..5e5cf6b04 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -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' diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md index 9a5fba622..6709f9704 100644 --- a/pkgs/test_core/CHANGELOG.md +++ b/pkgs/test_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.14 + +* Fix type cast when parsing a `null` hit map. + ## 0.6.13 * Require Dart 3.7 diff --git a/pkgs/test_core/lib/src/runner/coverage.dart b/pkgs/test_core/lib/src/runner/coverage.dart index 0eeb64939..bb29e6cb0 100644 --- a/pkgs/test_core/lib/src/runner/coverage.dart +++ b/pkgs/test_core/lib/src/runner/coverage.dart @@ -30,7 +30,16 @@ Future writeCoverage( await out.flush(); await out.close(); } - return HitMap.parseJson(coverage['coverage'] as List>); + return switch (coverage['coverage']) { + // Matching on `List` the runtime type of `List` in JSON is + // never `Map`. The `cast` below ensures the runtime type + // is correct for `HitMap.parseJson`. + List hitMapJson => HitMap.parseJson( + hitMapJson.cast>(), + ), + null => const {}, + _ => throw StateError('Invalid coverage data'), + }; } Future writeCoverageLcov( diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index 30587cd7f..65f9d41e6 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -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