Skip to content

Commit

Permalink
Re-enable test coverage reporting
Browse files Browse the repository at this point in the history
Fixed the cov command just like I'd done for the test command, so
that it will properly exit with an non-zero exit code on test failure.

Switched back to using the cov script for doing the tests.
  • Loading branch information
Reser, Ben authored and Reser, Ben committed Aug 12, 2017
1 parent 029102f commit e6f4902
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ before_script:
- git config --global user.email "ryan@ryanbreen.com"
- git config --global user.name "Ryan Breen"
script:
- npm run test
- npm run cov
deploy:
provider: npm
email: ryan@ryanbreen.com
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"bin": "./index.js",
"scripts": {
"test": "./test/test.sh",
"cov": "`npm bin`/istanbul cover --root . -x node_modules -x test --dir ./reports `npm bin`/_mocha -- --reporter spec -t 10000 test | bunyan",
"cov": "./test/test.sh cov",
"coveralls": "npm run cov && node_modules/coveralls/bin/coveralls.js < reports/lcov.info"
},
"licenses": [
Expand Down
10 changes: 9 additions & 1 deletion test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,12 @@

set -o pipefail

./node_modules/.bin/_mocha --reporter spec -t 10000 test | bunyan
bin=$(npm bin)
mocha_args='--reporter spec -t 10000 test'

if [ "$1" == "cov" ]; then
"$bin/istanbul" cover --root . -x node_modules -x test --dir ./reports \
"$bin/_mocha" -- $mocha_args | bunyan
else
"$bin/_mocha" $mocha_args | bunyan
fi

0 comments on commit e6f4902

Please sign in to comment.