vinicioslc / jest-badge-generator

πŸ“› A little cli that generates svg badges from your library using jest summary json and put into `.badges` folder.

Home Page:https://www.npmjs.com/package/jest-badge-generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Jest Badges Generator

Codacy Badge

This has inteded to be an package that generates jest badges to be used by your README.md or something like.

By default all badges are sended to .badges the files will be something like..

has option for convert to png too...

badge-branches.svg coverage-branches

badge-functions.svg coverage-function

badge-lines.svg coverage-lines

badge-statements.svg coverage-statements

How to

  1. Install this package as development dependency npm i jest-badge-generator -D

  2. you will need add follwing config to your jest tests section in package.json or in your jest.config.js

...
  "scripts": {
    "test": "jest --coverage",
    "test:make-badges": "npm run test && jest-badge-generator" // you have the options argument to convert for png with `jest-badge-generator --type "png"` this will convert output svg to png
  },
  "jest": {
    "coverageReporters": [
        "json",
        "json-summary",
        "lcov",
        "text",
        "text-summary"
    ],
    "testPathIgnorePatterns": [
        "/node_modules/"
    ],
    "testRegex": "(/__tests__/.*|\\.(test|spec))\\.jsx?$"
  },
...
  1. Run the tests npm run test:make-badges

Library Jest Health Summary

coverage-branches coverage-function coverage-lines coverage-statements

About

πŸ“› A little cli that generates svg badges from your library using jest summary json and put into `.badges` folder.

https://www.npmjs.com/package/jest-badge-generator


Languages

Language:JavaScript 100.0%