In my test directory, I have a file mocha.opts
containing the following:
--harmony
--recursive
--growl
--reporter spec
--require should
When I run mocha
, I get the following error:
/project/server/utilities/encryption.js:3
const
^^^^^
SyntaxError: Use of const in strict mode.
This is, of course, because my use of const
requires ES6 Harmony. When I run mocha --harmony
, my tests execute just fine. And the other entries in my mocha.opts
file work as expected.
Does the mocha.opts
file ignore the --harmony
argument for some reason? Or am I doing it wrong? The Mocha docs don't elaborate and I haven't been able to find the answer here or anywhere else.