1.1.5 • Published 4 years ago

jest-badge-generator v1.1.5

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

Jest Badges Generator

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

1.1.5

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago