visionmedia/mocha — pull request #1092 by FredKSchott (2014-01-01 00:15:43+00:00)
Title: Fixed Broken Nyan Reporter

The Nyan reporter is the only reporter that modified the reporter
prototype. This prototype is overwritten in the mocha.js compilation,
causing the reporter to fail when used in mocha.js. Normally mocha.js
is only used in browsers, where this reporter wouldn't work anyway. But
there are many CLIs that use mocha & phantomJS to run front-end tests
on the command line. Because they rely on mocha.js, Nyan wasn't working.

This commit removes the prototype modifications and moves functions off
of the NyanCat instance, instead binding them to be run with the correct
this context. This way the prototype can be properly overwritten in mocha.js
while still allowing the reporter to work as expencted.

See:
https://github.com/jdcataldo/grunt-mocha-phantomjs/issues/14
https://github.com/metaskills/mocha-phantomjs/issues/71#issuecomment-28753156