Skip to content

Commit 4b1259c

Browse files
committed
Add nyc and codecov for code coverage
1 parent 2ae0a55 commit 4b1259c

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
/node_modules/
1+
.nyc_output/
2+
coverage/
3+
node_modules/

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage/

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ language: node_js
22
node_js:
33
- lts/boron
44
- node
5+
after_script: bash <(curl -s https://codecov.io/bash)

package.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"unist-util-is": "^2.0.0"
3131
},
3232
"devDependencies": {
33+
"nyc": "^12.0.1",
3334
"prettier": "^1.13.3",
3435
"remark-cli": "^5.0.0",
3536
"remark-preset-wooorm": "^4.0.0",
@@ -39,8 +40,15 @@
3940
},
4041
"scripts": {
4142
"format": "remark . -qfo && prettier --write '**/*.js' && xo --fix",
42-
"test": "node test",
43-
"cov": "nyc --reporter lcov tape test.js"
43+
"test-api": "node test",
44+
"test-coverage": "nyc --reporter lcov tape test.js",
45+
"test": "npm run format && npm run test-coverage"
46+
},
47+
"nyc": {
48+
"check-coverage": true,
49+
"lines": 100,
50+
"functions": 100,
51+
"branches": 100
4452
},
4553
"prettier": {
4654
"tabWidth": 2,

0 commit comments

Comments
 (0)