visionmedia/mocha — pull request #1009 by demmer (2013-10-17 14:23:57+00:00)
Title: reporter-specific options and support for the xunit reporter to output to a file

This is a less pervasive change to accomplish the same goal as #897 -- i.e. to have a way of separating the xunit reporter output from stdout so that it can be used in a CI system.

In this approach I changed the mocha core to pass a set of reporter-specific options to the reporter class, as well as to call the reporter's done() method to give it a chance to clean things up.

Then the xunit reporter supports an output option to specify a filename, and flushes the file in done().