visionmedia/mocha — pull request #661 by chakrit (2012-11-17 16:56:25+00:00)
Title: Try/catch guard on require()-ing test files. [fixes #655]

Syntax errors in test files will cause mocha to crash since it is using
simple require() to load the test files.

So I've added a try/catch guard against the require() call.

Since error handling (and console colors configuration) is embedded in
`lib/runnable.js` and `lib/runner.js` which isn't available when we are
just loading the tests, I have made it prints out the error message and
error stack to `process.stderr` for the time being.

This also breaks out of the file `--watch` loop which makes it very
annoying when you just misplaced one simple character and have to switch
to your other tdd window to restart the tests.