kmiyashiro / grunt-mocha

[MOVED] Grunt task for running mocha specs in a headless browser (PhantomJS)
MIT License
370 stars 106 forks source link

Added support for mocha hooks #128

Open DepthDeluxe opened 10 years ago

DepthDeluxe commented 10 years ago

Added support for a pretty undocumented feature of mocha. When mocha is run programmatically (i.e. mocha.run()), the function returns a runner object which has events a user can subscribe to. This can be useful for utilities such as code coverage reporting which needs to be performed after mocha tests are done in phantomjs.

See this article for a more in-depth explanation of the hooks.

DepthDeluxe commented 10 years ago

resolves #44. User can subscribe to the end hook to POST coverage information to a middleware service like istanbul-middleware.

kmiyashiro commented 9 years ago

Oops, seems I missed this one. Some test coverage would be all that's required for this to be merged! Especially since it is undocumented.