jdavis/grunt-cafe-mocha — pull request #2 by Couto (2013-04-28 23:51:23+00:00)
Title: Quick and dirty support for coverage

A really quick and dirty way of supporting code coverage tests.

```
cafemocha: {
unit: {
src: '<%= files.test %>',
options: {
ui: 'exports',
reporter: 'nyan'
}
},
coverage: {
files: { 'coverage/index.html': '<%= cafemocha.unit.src %>'},
options: {
ui: 'exports',
reporter: 'html-cov',
env: 'JOHNNIE_COVERAGE'
}
}
}
```

it does by intercepting mocha's `stdout` and writing the info in the destination file, it also supports an environmental variable so that is possible to load the previously converted files for coverage analysis, just like specified [here](http://tjholowaychuk.com/post/18175682663/mocha-test-coverage)

_Note_: this doesn't run the [jscoverage](https://github.com/visionmedia/node-jscoverage) binary, I've chosen to do it with a separated task, since I believe that it distances itself from this tasks context.

Also this was really quick and dirty, you might want to do some tests first :worried: