Giter VIP home page Giter VIP logo

db_test_coverage's Introduction

db_test_coverage

test coverage tool for dart, flutter.

Overview

A command-line tool that run tests with coverage on a project.

It’s help you automate verification that your project code coverage meet your expected standard.

license.


Installation

db_test_coverage is dependent on lcov being installed.

So first install lcov.

MacOS

brew install lcov

Linux

apt install lcov

After, installing lcov you can run.

pub global activate db_test_coverage


Usage

test_coverage --package-name example <local project directory>
Options:
--project-type                        Specify the type of project the script is run on

      [flutter] (default)             Test coverage for flutter project

--package-name (mandatory)            Specify the package name of this project
--src-dir                             Specify the src directory of this project
                                      (defaults to "lib/src")
--test-dir                            Specify the test directory of this project
                                      (defaults to "test")
--coverage-dir-path                   Specify the test coverage directory of this project
                                      (defaults to ".test_coverage")
--coverage-exclude=<lib/**.g.dart>    Specify the file pattern from the coverage report

--min-cov                             Specify the minimum coverage percentage of code coverage allowed, from 0.0 to 1.0
                                      (defaults to "0.0")
--[no-]help                           Print help message

Run db_test_coverage and check if code coverage is at least 70%

test_coverage --package-name example --min-cov 0.7 <local project directory>

Run db_test_coverage but removed unneeded files from the code coverage report.

test_coverage --package-name example --coverage-exclude 'lib/src/*.g.dar', 'lib/generated_plugin_registrant.dart' <local project directory>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.