Is there a .mocha file where I can specify defaults such as --no-colors?

mcandre picture mcandre · Apr 11, 2013 · Viewed 46.9k times · Source

I'd like to set some defaults for mocha without having to type them each time. Does mocha look for a config file / dotfile anywhere, as jshint looks for .jshintrc and npm looks for package.json?

Answer

zs2020 picture zs2020 · Apr 11, 2013

Yes. You can create a file ./test/mocha.opts and in the file you can specify --no-colors.

See mocha.opts on Mocha Doc for more information.