Skip to content

Commit 219d6f5

Browse files
committed
Add coverage tests
1 parent 0522e7a commit 219d6f5

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.DS_Store
22
*.log
3+
.nyc_output/
4+
coverage/
35
node_modules/
46
yarn.lock

.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 & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"unist-util-visit": "^1.4.0"
3636
},
3737
"devDependencies": {
38+
"nyc": "^12.0.2",
3839
"prettier": "^1.14.2",
3940
"tape": "^4.4.0",
4041
"unist-builder": "^1.0.1",
@@ -43,7 +44,15 @@
4344
},
4445
"scripts": {
4546
"format": "prettier --write \"**/*.js\" && xo --fix",
46-
"test": "node test"
47+
"test-api": "node test",
48+
"test-coverage": "nyc --reporter lcov tape test.js",
49+
"test": "npm run format && npm run test-coverage"
50+
},
51+
"nyc": {
52+
"check-coverage": true,
53+
"lines": 100,
54+
"functions": 100,
55+
"branches": 100
4756
},
4857
"prettier": {
4958
"tabWidth": 2,

0 commit comments

Comments
 (0)