Search packages, repositories and app categories

Package detailsv1.0.0

full_coverage

A package script for allowing coverage test tool to see all Dart files.

AndroidiOSmacOSWindowsLinux
30-day downloads
12K
Likes
24
Pub points
155

Install package

flutter pub add full_coverage

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The full_coverage package is a script tool designed to ensure coverage testing tools can detect and analyze all Dart files in a Flutter project. It addresses common issues where certain files are excluded from coverage reports due to how the test runner discovers source files. By integrating this package, developers gain more accurate code coverage metrics across the entire codebase, improving testing reliability. It supports multiple platforms including Android, iOS, macOS, Windows, and Linux.

Use cases

  • Ensuring complete code coverage in CI/CD pipelines
  • Improving test reporting accuracy
  • Debugging missing coverage for specific files
  • Supporting comprehensive testing workflows
  • Integrating with coverage analysis tools

Key features

  • Automatically includes all Dart files in coverage scanning
  • Simple integration via Flutter pub add
  • Cross-platform compatibility
  • Enhances visibility of untested code
  • Works seamlessly with existing test suites

Suitable for

  • Flutter teams focused on high test coverage
  • CI/CD environments requiring reliable coverage data
  • Developers troubleshooting coverage gaps
  • Projects using coverage tools like `coverage` or `dart test --coverage`
  • Teams aiming for compliance with testing standards

Considerations

  • Requires proper configuration in test scripts
  • May need adjustments if custom file discovery is used
  • Not a standalone testing tool but a supplement
  • Best used alongside structured testing practices
  • Does not generate tests—only improves coverage visibility

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

full_coverage

Coverage tools like codecov only see the files that were actually triggered by tests. This means that a coverage of 100% can easily be a lie, e.g. you can just write a dummy test that does not import any files and a coverage tool will ignore all the code base.

Luckily, this package resolves this problem.

How it works

The full_coverage package harvests the power of Bash to find all files in specified directory, by default it is lib directory, where all Flutter files are. It then creates a dummy test file test/full_coverage_test.dart that imports all the Dart files that were found and has an empty void main() {} function so that it actually starts.

Install

Use this command:

dart pub global activate full_coverage

Execute

Use the command:

dart pub global run full_coverage

Or add the cache-system to your PATH environment variable for run directly. Check documentation for more;

full_coverage

Other commands

-i, --ignore       Ignore files. ex (*_widget.dart,*_page.dart).
-h, --[no-]help    usage doc.

For more details Telegram Group Flutterando.

Categories

Dependencies

Dependency list 2 items

Source repository

Projects using this package