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...
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