rackspace/pkgcloud — pull request #1 by maxlinc (2013-06-18 17:20:38+00:00)
Title: Code coverage

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).