kmiyashiro/grunt-mocha — pull request #81 by demmer (2013-08-06 21:00:24+00:00)
Title: Add an option to log uncaught script errors as grunt errors.

Phantomjs emits events for uncaught exceptions in the source code, but these aren't handled by grunt-mocha. This means that a test may fail due to an exception, but there's no console indication as to what the problem is.

The patch adds an optional error handler that formats the error message and stack trace and then logs it as a grunt error. The option currently defaults to false -- personally, I would prefer to make the default true, however since that could break existing tests, I figured this was the more conservative route.