visionmedia/mocha — pull request #930 by misterdjules (2013-07-19 14:47:40+00:00)
Title: Support for multiple reporters

Hi!

This pull request adds support for multiple reporters.

One of my use cases for multiple reporters is described in my recent post on [mocha's google group](https://groups.google.com/forum/#!topic/mochajs/l7QrifO2bdE). To sum it up, I'm using mocha to run tests on a Bamboo instance, and I use the xunit-file reporter to create a file that can be parsed by Bamboo to display tests results. However, I also need to send tests reports to a CouchDB instance that doesn't accept xml files, but JSON documents. Right now, I'm running the tests twice: first with the xunit-file reporter, and then with the mocha-json-file-reporter to generate the xunit file and the json document. This has a number of cons like slowing down the whole process, and even sometimes not generating the exact same results, which can lead to a lot of confusion.

These changes allow me to run both reporters at the same time, and I think being able to run more than one reporter at a time can be useful to others. All the tests seem to run fine.