nodejitsu/pkgcloud — pull request #162 by kenperkins (2013-06-19 20:25:35+00:00)
Title: [test] Add Code Coverage for pkgcloud

Adds code coverage report. Can run with either make test-cov or npm run-script test-cov.

Note: the usual way to setup coverage seems to be to modify all your require statements so they can load from either lib or lib-cov, based on an environment variable. I took the approach of temporarily replacing lib with lib-cov. That's fewer changes, but can potentially leave your lib folder in a bad state. That only happens if you run coverage (which is not on by default for npm test), and can be fixed by restoring from lib-bak or via git checkout and git clean.

Coveralls *should* work as well via test-coveralls, but it is looking for files in the wrong path. I think it may be a node-coveralls bug. Coveralls is the goal, because then it will tell whether Pull Requests increase or decrease coverage. I'm not a fan of explicit coverage targets, but I like this tool for [finding untested code](http://martinfowler.com/bliki/TestCoverage.html).