When trying to use Mocha (version 1.3.2) in the browser, along the lines of the given example, I get the following exception when trying to specify acceptable globals in the expected way (i.e. with something like mocha.globals(['amplify', '_'])):
Uncaught TypeError: Object function Mocha(options) {
options = options || {};
this.files = [];
this.options = options;
this.grep(options.grep);
this.suite = new exports.Suite('', new exports.Context);
this.ui(options.ui);
this.reporter(options.reporter);
if (options.timeout) this.suite.timeout(options.timeout);
} has no method 'globals'
This is exhibited in Chrome 21.0.1180.
One may reproduce this by going to the given example link, and in the browser console run mocha.globals(['123']).
I would expect mocha.globals to work as the linked example suggests, or there to be some documentation about an alternative, but I have found none.
This is issue #42 on visionmedia/mocha GitHub. The solution is, in Coffeescript: