Currently, package:coverage utilities (such as test_with_coverage, collect_coverage, and format_coverage) are designed around the Dart VM Service API and gather coverage metrics exclusively from Dart VM isolates.
When running tests targeting web or browser platforms (e.g. dart test -p chrome), package:test collects V8 JavaScript JSON coverage files (e.g. my_test.dart.chrome.json). However:
dart run coverage:test_with_coverage does not support collecting or orchestrating web/Chrome test runs.
- Running
collect_coverage against a -p chrome test run produces an empty VM coverage file ({"type":"CodeCoverage","coverage":[]}).
- Collecting code coverage across full-stack applications (where backend Shelf SSR runs on the VM and frontend components run in V8) requires manual multi-step compilation and formatting.
It would be fantastic if package:coverage (test_with_coverage and format_coverage) could natively support collecting, parsing, and unifying Web/V8 JS coverage data alongside Dart VM coverage into a single LCOV report.
Related context / demand: See also #471 where developers run into hangs attempting to use --coverage with -p chrome.
Currently,
package:coverageutilities (such astest_with_coverage,collect_coverage, andformat_coverage) are designed around the Dart VM Service API and gather coverage metrics exclusively from Dart VM isolates.When running tests targeting web or browser platforms (e.g.
dart test -p chrome),package:testcollects V8 JavaScript JSON coverage files (e.g.my_test.dart.chrome.json). However:dart run coverage:test_with_coveragedoes not support collecting or orchestrating web/Chrome test runs.collect_coverageagainst a-p chrometest run produces an empty VM coverage file ({"type":"CodeCoverage","coverage":[]}).It would be fantastic if
package:coverage(test_with_coverageandformat_coverage) could natively support collecting, parsing, and unifying Web/V8 JS coverage data alongside Dart VM coverage into a single LCOV report.Related context / demand: See also #471 where developers run into hangs attempting to use
--coveragewith-p chrome.