When you execute your test by mocha command, it will executes your test script in node.js without ES6, because V8 yet doesn't implemented ES6.
You can use compillers of mocha. If youYou has babel-core, you can use this command (it's better in your case):
mocha src/**/*.spec.js --compilers js:babel-core/register Or install babel-register standalone (babel-register module) and use:
mocha --compilers js:babel-register See more in: http://jamesknelson.com/testing-in-es6-with-mocha-and-babel-6/