Coder Social home page Coder Social logo

h3nste1n / coverage-badge-creator Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 15.0 373 KB

Coverage Badge Creator creates badges based on your test coverage and inserts them into the README.

Home Page: https://www.npmjs.com/package/coverage-badge-creator

License: MIT License

TypeScript 98.01% JavaScript 1.99%
coverage badges markdown nyc jest mocha chai coverage-badge

coverage-badge-creator's Introduction

Coverage Badge Creator


CI Build Code-Style

MIT License Release Maintenance

Table of Contents
  1. About The Project
  2. Installation
  3. Usage
  4. Config
  5. Requirements
  6. Built With
  7. Contributing
  8. License
  9. Contact
  10. Acknowledgements

About The Project

Coverage Badge Creator is a super easy to use tool for your project. It creates badges based on your test coverage and inserts them into the README. All without any third-party libraries or tools.

Installation

npm:

npm install --save-dev coverage-badge-creator

yarn:

yarn add --dev coverage-badge-creator

Usage

  1. First you need to set up your test environment.

  2. Insert one of the following keys anywhere in your README. These will be replaced by the coverage-badge-creator with the appropriate badge.

    The following keys are available:

    • $coverage$
    • $statements$
    • $branches$
    • $functions$
    • $lines$

    important are also the surrounding dollar signs


  3. Now you can create the badges.

    Add the command to your package.json scripts block:

    "scripts": {
      "coverage:badge": "coverage-badge-creator",
    }   

    and run it from the CLI:

    npm run coverage:badge

Config

There are various ways to configure the badges according to your wishes. To do this, you only need to create a new file called .badge-config. Then you have the following options:

For a simple example click here.

coverage file path

{
  coverage_file_path: './coverage/json-summary.json'
}

badges

 {
   badges: {
     coverage: {
      logo: 'foo'
      color: 'bar'
     }
   }
 }

Depending on your test tool, you will probably have the following badges available for configuration:

  • coverage
  • statements
  • branches
  • functions
  • lines

Options

  • style
    plastic flat flat-square flat-for-the-badge social
  • logo
    kotlin medium github
  • logoColor
    blue green white
  • color
    blue green white
  • link
    blue green white

For more information on all options, see ->

Extended

In addition, you have further options in the cli.

  • --config

    This allows you to change the path and name of the configuration file.

    "scripts": {
      "coverage:badge": "coverage-badge-creator --config './badge-coverage-config.json'",
    }

Requirements

  • Node > v10.0.0

Built With

This section lists all programming languages and main frameworks.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/new_feature)
  3. Commit your Changes (git commit -m 'feat: Add new feature')
  4. Push to the Branch (git push origin feature/new_feature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

This npm package is primarily the work of Henry Steinhauer (H3nSte1n), for full list of contributors see the contributors graph.

Acknowledgements

coverage-badge-creator's People

Contributors

h3nste1n avatar pupiltong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.