Create a coverage badge
Creates a code coverage badge like the following:
Currently just reads from Istanbul's JSON summary reporter and downloads a badge from https://shields.io/. Don't expect too much! Send a PR if you need configuration etc.
(For Create React Apps)
package.json
):"jest": {
"coverageReporters": [
"json-summary"
]
}
npm test -- --coverage
make-coverage-badge
Resulting badge will be in ./coverage/badge.svg
.
--output-path <path>
Writes the coverage badge to the given path (relative to project root). Defaults to ./coverage/badge.svg
.
--report-path <path>
Path to a coverage report file. Defaults to ./coverage/coverage-summary.json
.
© 2019 Tom Vincent [email protected] (https://tlvince.com)
Released under the MIT license.