Skip to content

Commit 7c86f19

Browse files
committed
build: use nyc for test coverage
1 parent b057205 commit 7c86f19

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.nyc_output/
12
coverage/
23
node_modules/
34
npm-debug.log

.travis.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,8 @@ before_install:
2323
- "test ! -d node_modules || npm prune"
2424
- "test ! -d node_modules || npm rebuild"
2525
script:
26-
# Run test script, depending on istanbul install
27-
- "test ! -z $(npm -ps ls istanbul) || npm test"
28-
- "test -z $(npm -ps ls istanbul) || npm run-script test-travis"
26+
# Run test script, then lint depending on eslint install
27+
- "npm run-script test-travis"
2928
- "test -z $(npm -ps ls eslint) || npm run-script lint"
3029
after_script:
31-
- "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
30+
- "test -d .nyc_output && npm install coveralls@2 && nyc report --reporter=text-lcov | coveralls"

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
"eslint": "3.19.0",
2323
"eslint-plugin-markdown": "1.0.0-beta.6",
2424
"finalhandler": "1.0.6",
25-
"istanbul": "0.4.5",
2625
"mocha": "3.5.3",
26+
"nyc": "10.3.2",
2727
"supertest": "1.2.0"
2828
},
2929
"files": [
@@ -39,7 +39,7 @@
3939
"scripts": {
4040
"lint": "eslint --plugin markdown --ext js,md .",
4141
"test": "mocha --reporter spec --bail --check-leaks test/",
42-
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
43-
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
42+
"test-cov": "nyc --reporter=text npm test",
43+
"test-travis": "nyc --reporter=html --reporter=text npm test"
4444
}
4545
}

0 commit comments

Comments
 (0)