Skip to content

Commit

Permalink
build: use nyc for test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Oct 14, 2017
1 parent b057205 commit 7c86f19
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,3 +1,4 @@
.nyc_output/
coverage/
node_modules/
npm-debug.log
7 changes: 3 additions & 4 deletions .travis.yml
Expand Up @@ -23,9 +23,8 @@ before_install:
- "test ! -d node_modules || npm prune"
- "test ! -d node_modules || npm rebuild"
script:
# Run test script, depending on istanbul install
- "test ! -z $(npm -ps ls istanbul) || npm test"
- "test -z $(npm -ps ls istanbul) || npm run-script test-travis"
# Run test script, then lint depending on eslint install
- "npm run-script test-travis"
- "test -z $(npm -ps ls eslint) || npm run-script lint"
after_script:
- "test -e ./coverage/lcov.info && npm install coveralls@2 && cat ./coverage/lcov.info | coveralls"
- "test -d .nyc_output && npm install coveralls@2 && nyc report --reporter=text-lcov | coveralls"
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -22,8 +22,8 @@
"eslint": "3.19.0",
"eslint-plugin-markdown": "1.0.0-beta.6",
"finalhandler": "1.0.6",
"istanbul": "0.4.5",
"mocha": "3.5.3",
"nyc": "10.3.2",
"supertest": "1.2.0"
},
"files": [
Expand All @@ -39,7 +39,7 @@
"scripts": {
"lint": "eslint --plugin markdown --ext js,md .",
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
"test-cov": "nyc --reporter=text npm test",
"test-travis": "nyc --reporter=html --reporter=text npm test"
}
}

0 comments on commit 7c86f19

Please sign in to comment.