Cannot run Mocha with CoffeeScript

As of Mocha 1.0:

coffee-script is no longer supported out of the box. CS and similar transpilers may be used by mapping the file extensions (for use with --watch) and the module name. For example --compilers coffee:coffee-script with CoffeeScript 1.6- or --compilers coffee:coffee-script/register with CoffeeScript 1.7+.

(Quoting http://visionmedia.github.io/mocha/#compilers-option) So, you need to add the line

--compilers coffee:coffee-script/register

or, for CS <= 1.6.x,

--compilers coffee:coffee-script

to your mocha.opts file.


From CoffeeScript 1.7 onwards, the option should be:

--compilers coffee:coffee-script/register

An issue was filed on Mocha's github site.