jest-badge-generator
v1.1.5
Published
Create a group of coverage badges from jest to an output folder
Downloads
4,651
Readme
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
badge-functions.svg
badge-lines.svg
badge-statements.svg
How to
Install this package as development dependency
npm i jest-badge-generator -D
you will need add follwing config to your jest tests section in
package.json
or in yourjest.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?$"
},
...
- Run the tests
npm run test:make-badges
Library Jest Health Summary