File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 1- # check-code-coverage [ ![ ci status] [ ci image ]] [ ci url ] ![ mock coverage] ( https://img.shields.io/badge/code--coverage-100-brightgreen )
1+ # check-code-coverage [ ![ ci status] [ ci image ]] [ ci url ] ![ mock coverage] ( https://img.shields.io/badge/code--coverage-100% -brightgreen )
22> Utilities for checking the coverage produced by NYC against extra or missing files
33
44## Use
@@ -34,14 +34,19 @@ check-total --from coverage/coverage-summary.json --min 80
3434
3535If your README.md includes Shields.io badge, like this
3636
37- 
37+ 
3838
3939You can update it using statements covered percentage from ` coverage/coverage-summary.json ` by running
4040
4141``` shell
4242update-badge
4343```
4444
45+ If the coverage summary has 96%, then the above badge would be updated to
46+
47+
48+ 
49+
4550Related project: [ dependency-version-badge] ( https://github.com/bahmutov/dependency-version-badge )
4651
4752[ ci image ] : https://github.com/bahmutov/check-code-coverage/workflows/ci/badge.svg?branch=master
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ function updateBadge() {
1515 function replaceShield ( ) {
1616 // note, Shields.io escaped '-' with '--'
1717 const coverageRe = new RegExp (
18- 'https://img\\.shields\\.io/badge/code--coverage-(\\d+)-brightgreen' ,
18+ 'https://img\\.shields\\.io/badge/code--coverage-(\\d+)% -brightgreen' ,
1919 )
20- const coverageBadge = `https://img.shields.io/badge/code--coverage-${ pct } -brightgreen`
20+ const coverageBadge = `https://img.shields.io/badge/code--coverage-${ pct } % -brightgreen`
2121
2222 const updatedReadmeText = readmeText . replace (
2323 coverageRe ,
You can’t perform that action at this time.
0 commit comments