make-coverage-badge--logo
v1.1.0
Published
Create a coverage badge
Downloads
16
Readme
Fork: make-coverage-badge
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.
Usage
(For Create React Apps)
- Configure Jest (in
package.json
):
"jest": {
"coverageReporters": [
"json-summary"
]
}
- Run
npm test -- --coverage
- Run
make-coverage-badge
Resulting badge will be in ./coverage/badge.svg
.
Options
--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
.
--logo <logo-string>
A string defining a logo usable by https://shields.io/. Their documentation has details on using logos. No default.
Prior work
- Coveralls: paid for private repos
- coverage-badger: same approach, but using an XML report and therefore requires XML dependencies
Author
© 2019 Tom Vincent [email protected] (https://tlvince.com)
License
Released under the MIT license.