Skip to content

Commit 4410537

Browse files
authored
Improve & report code coverage (#471)
* Replace nyc with c8 for more accurate coverage * Add code coverage reporting from CI via codecov.io * Add codecov.io config file
1 parent ad596dc commit 4410537

File tree

5 files changed

+16
-5
lines changed

5 files changed

+16
-5
lines changed

.github/codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
comment:
2+
require_changes: true
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
informational: true
9+
patch:
10+
default:
11+
informational: true

.github/workflows/nodejs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,5 @@ jobs:
3535
- run: git diff --stat --exit-code
3636
- run: npx prettier --check .
3737
- run: npm run coverage
38+
- run: npx c8 report --reporter=lcov
39+
- uses: codecov/codecov-action@v3

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ package-lock.json
77
bench/*.svg
88
bench/dist/
99
bench/node_modules
10-
.nyc_output/
1110
coverage/

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.nyc_output/
21
bench/
32
coverage/
43
node_modules/

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@
6767
"scripts": {
6868
"lint": "eslint --fix *.js lib/ test/",
6969
"test": "node test/run-tests.js",
70-
"coverage": "nyc --reporter=text --reporter=html npm test",
70+
"coverage": "c8 --reporter=text --reporter=html npm test",
7171
"prettier": "prettier --write .",
72-
"clean": "rm -rf coverage .nyc_output",
72+
"clean": "rm -rf coverage",
7373
"toc": "doctoc --github --notitle README.md CONTRIBUTING.md"
7474
},
7575
"devDependencies": {
76+
"c8": "^7.12.0",
7677
"doctoc": "^2.2.1",
7778
"eslint": "^8.24.0",
7879
"eslint-config-prettier": "^8.5.0",
79-
"nyc": "^11.7.1",
8080
"prettier": "^2.7.1"
8181
},
8282
"dependencies": {

0 commit comments

Comments
 (0)