There are fantastic tools for coverage badges such as Coveralls but, for free, they only cover public repositories
What then if a repository is private? Bind it to a process run locally with Istanbul Readme Badges
One can follow the very README.md of the project but in short here is what is needed:
npm i -D istanbul-badges-readme
- A README.md file with additional markup into which the badges are inserted
| Statements | Branches | Functions | Lines |
| ------------------------- | ----------------------- | ------------------------ | -------------------- |
| ![Statements](#branches#) | ![Branches](#branches#) | ![Functions](#branches#) | ![Lines](#branches#) |
- Run the script anywhere, either in a, e.g.
pre-commit
husky hook, or in a pure NPM script directly
node_modules/.bin/istanbul-badges-readme
Top comments (2)
It's useful, thanks for sharing
You rock, dude!