Giter Club home page Giter Club logo

make-coverage-badge's Introduction

make-coverage-badge

Build Status npm version License

Create a coverage badge

Creates a code coverage badge like the following:

Coverage badge

Currently just reads from Istanbul's JSON summary reporter and downloads a badge from https://shields.io/. Don't expect too much! Send a PR if you need configuration etc.

Usage

(For Create React Apps)

  1. Configure Jest (in package.json):
"jest": {
  "coverageReporters": [
    "json-summary"
  ]
}
  1. Run npm test -- --coverage
  2. Run make-coverage-badge

Resulting badge will be in ./coverage/badge.svg.

Options

--output-path <path>

Writes the coverage badge to the given path (relative to project root). Defaults to ./coverage/badge.svg.

--report-path <path>

Path to a coverage report file. Defaults to ./coverage/coverage-summary.json.

Prior work

  • Coveralls: paid for private repos
  • coverage-badger: same approach, but using an XML report and therefore requires XML dependencies

Author

© 2019 Tom Vincent [email protected] (https://tlvince.com)

License

Released under the MIT license.

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.