Skip to content

Commit

Permalink
Makefile changes to enable test coverage from coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
sulkaharo committed Aug 18, 2016
1 parent f693afc commit 3b920c3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ sudo: false
node_js:
- "0.10"
- "0.12"
script: make test
script: make travis
after_script: make report
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
TESTS=tests/*.js
ISTANBUL=./node_modules/.bin/istanbul
MOCHA=./node_modules/mocha/bin/_mocha
ANALYZED=./coverage/lcov.info

all: test

report:
# report results to community
test:
./node_modules/.bin/mocha ${TESTS}

travis:
${ISTANBUL} cover ${MOCHA} --report lcovonly -- -R tap ${TESTS}

report:
test -f ${ANALYZED} && \
(npm install coveralls && cat ${ANALYZED} | \
./node_modules/.bin/coveralls) || echo "NO COVERAGE"
test -f ${ANALYZED} && \
(npm install codacy-coverage && cat ${ANALYZED} | \
YOURPACKAGE_COVERAGE=1 ./node_modules/codacy-coverage/bin/codacy-coverage.js) || echo "NO COVERAGE"

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
"yargs": "~4.3.2"
},
"devDependencies": {
"coveralls": "^2.11.12",
"mocha": "^2.3.3",
"mocha-lcov-reporter": "^1.2.0",
"should": "^7.1.0"
},
"config": {
Expand Down

0 comments on commit 3b920c3

Please sign in to comment.