I have an application ( https://github.com/idmillington/dendry ) that uses Travis CI to monitor build status. I use a general coverage report in Istanbul, and I would like to send it to Coveralls to create a coverage button for README.
All this I can get. But...
When I run npm test locally, I do not want to send coveralls coverage data. I usually do npm test dozens of times for each commit. But when I click and Travis does everything, I would like Travis to update the cover for me.
There might be something like this in my package.json package:
"scripts": { "test": "./node_modules/.bin/istanbul test ./node_modules/.bin/_mocha", }
This is normal for the local user and does not update Coveralls, but Travis will also not update Coveralls. Or I could do:
"scripts": { "test": "./node_modules/.bin/istanbul test ./node_modules/.bin/_mocha && ./node_modules/coveralls/bin/coveralls.js < ./coverage/lcov.info", }
This is ideal for Travis, but every time I run npm test locally, it tries to transfer data to Coveralls.
As far as I can tell, I can't ask Travis to run something other than npm test .
I do not want to ask potential users or contributors so that they cannot verify using
$ npm run-script test-local
or some of them, especially since running npm test will result in a loading error without the correct private key for coveralls.
Is there a way to get the right behavior here?