May 5, 2016

node.js project coverage with codeship.io && coveralls.io

coveralls.io is great. however, the default instruction sets are tailored to ruby and travis. i use neither.

for many of us, we want coveralls to work with codeship.io and nodejs.

the coveralls docs re-direct you to: https://github.com/nickmerwin/node-coveralls, which helps us get the job done. however, you may like just a simple clear step-by-step.

Here are the steps, short and sweet:

// package.json
{
  "name": "MY-MODULE",
  "description": "A SUPER GREAT MODULE",
   ...
  "scripts": {
    "test": "nyc --reporter=lcov --check-coverage --functions=90 --branches=90 node test/"
    }
}    



npm test # or your test command  
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js  


COVERALLS_SERVICE_NAME=codeship  
COVERALLS_REPO_TOKEN=YOUR_SECRET_COVERALLS_TOKEN  


You're all done!

  • LinkedIn
  • Tumblr
  • Reddit
  • Google+
  • Pinterest
  • Pocket
Comments powered by Disqus