coverage
1.16.1, released 2 days ago by tools.dart.dev
Collects, manipulates, and formats code coverage data in Dart
Rock solid
What it does
Provides tools to collect coverage JSON from the Dart VM Service and format it into LCOV or pretty-printed formats. Supports ignoring specific lines or ranges from coverage and handling function or branch coverage.
AI-written summary of version 1.16.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to generate lcov.info files for test coverage reporting
- You want to collect coverage data from the Dart VM Service
- You need to filter out ignored lines using coverage comments
Skip it when
- You are looking for a state management or UI library
- You do not need test coverage metrics for your Dart project
Strengths
- Supports LCOV and pretty-printed format output
- Supports function and branch coverage collection
- Provides comment directives to ignore lines or files from coverage
Weaknesses
- Web coverage percentage metrics and line counts are not directly comparable to VM runs
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 12
Run dart pub global activate coverage and optionally add the executables to your PATH.
dart pub global run coverage:test_with_coverageWorks with
Packages commonly used together with coverage: ones it builds on, ones built on it, and its own family.
- vm_servicecoverage depends on itA library to communicate with a service implementing the Dart VM service protocol.
- yamlcoverage depends on itA Dart library for parsing YAML documents into Dart data structures.
- stack_tracecoverage depends on itProvides parsing, inspection, and readable formatting of Dart stack traces.
- globcoverage depends on itA file and directory globbing library that supports Bash-style path matching and listing.
- package_configcoverage depends on itRead and write Dart package configuration files.
- source_mapscoverage depends on itA Dart library to parse, build, and manipulate source map v3 files.
- argscoverage depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- loggingcoverage depends on itProvides configurable logging with levels and stream listeners for Dart apps.