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 )
2
2
> Utilities for checking the coverage produced by NYC against extra or missing files
3
3
4
4
## Use
@@ -34,14 +34,19 @@ check-total --from coverage/coverage-summary.json --min 80
34
34
35
35
If your README.md includes Shields.io badge, like this
36
36
37
- 
37
+ 
38
38
39
39
You can update it using statements covered percentage from ` coverage/coverage-summary.json ` by running
40
40
41
41
``` shell
42
42
update-badge
43
43
```
44
44
45
+ If the coverage summary has 96%, then the above badge would be updated to
46
+
47
+
48
+ 
49
+
45
50
Related project: [ dependency-version-badge] ( https://github.com/bahmutov/dependency-version-badge )
46
51
47
52
[ 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() {
15
15
function replaceShield ( ) {
16
16
// note, Shields.io escaped '-' with '--'
17
17
const coverageRe = new RegExp (
18
- 'https://img\\.shields\\.io/badge/code--coverage-(\\d+)-brightgreen' ,
18
+ 'https://img\\.shields\\.io/badge/code--coverage-(\\d+)% -brightgreen' ,
19
19
)
20
- const coverageBadge = `https://img.shields.io/badge/code--coverage-${ pct } -brightgreen`
20
+ const coverageBadge = `https://img.shields.io/badge/code--coverage-${ pct } % -brightgreen`
21
21
22
22
const updatedReadmeText = readmeText . replace (
23
23
coverageRe ,
You can’t perform that action at this time.
0 commit comments