Skip to content

Commit 26b611d

Browse files
committed
Add coverage tests
1 parent b2959da commit 26b611d

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.DS_Store
22
*.log
3-
/node_modules/
3+
.nyc_output/
4+
coverage/
5+
node_modules/
46
yarn.lock

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
coverage/

.travis.yml

+1
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

+10-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"object-assign": "^4.1.0"
3030
},
3131
"devDependencies": {
32+
"nyc": "^12.0.2",
3233
"prettier": "^1.14.2",
3334
"remark-cli": "^5.0.0",
3435
"remark-preset-wooorm": "^4.0.0",
@@ -37,7 +38,15 @@
3738
},
3839
"scripts": {
3940
"format": "remark . -qfo && prettier --write \"**/*.js\" && xo --fix",
40-
"test": "node test"
41+
"test-api": "node test",
42+
"test-coverage": "nyc --reporter lcov tape test.js",
43+
"test": "npm run format && npm run test-coverage"
44+
},
45+
"nyc": {
46+
"check-coverage": true,
47+
"lines": 100,
48+
"functions": 100,
49+
"branches": 100
4150
},
4251
"prettier": {
4352
"tabWidth": 2,

test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
'use strict'
22

3-
var u = require('..')
4-
53
var test = require('tape')
4+
var u = require('.')
65

76
test(function(t) {
87
t.deepEqual(

0 commit comments

Comments
 (0)