talira

coverage

Coverage data collection, manipulation and formatting for Dart

open sourceBSD-3-Clausefree

coverage is the Dart team's package for collecting and formatting code coverage in Dart. Its collect_coverage tool gathers coverage JSON from the Dart VM Service, format_coverage turns it into LCOV or a pretty-printed report, and test_with_coverage runs a package's tests and writes coverage/lcov.info in one step. It installs with dart pub global activate coverage, has partial support for pub workspaces, and is BSD-3-Clause licensed. It lives in the dart-lang/tools monorepo.

Problems it solves

  • measure test coverage of my Dart package
  • generate an lcov.info file from my Dart tests for a coverage service
  • see which lines of my Dart code my tests never run

Features

  • test_with_coverage runs tests and writes lcov.info in one command
  • collect_coverage reads coverage from the Dart VM Service
  • format_coverage outputs LCOV or pretty-printed reports
  • partial support for pub workspaces

Alternatives

The same job

These do what coverage does.

  1. Coveralls We help you deliver code confidently by showing which parts of your code aren't covered by tests.
  2. Codecov More than just code coverage.
  3. pytest-cov Pytest plugin for measuring coverage

Compare coverage with the top 3