Karma doesn't recognize ES6 keywords in strict mode


#1

My karma.config.js uses ES6 keywords like “const” which should work in ‘use strict’ mode (and of course run with the same version of karma locally).

const HTML_RESULTS_DIR = ‘testing/karma/reports’;
^^^^^
16 04 2016 02:05:38.780:ERROR [config]: Invalid config file!
SyntaxError: Use of const in strict mode.

So something in the karma build environment is different?


#2

Karma will only run the tests and it is up to the browser to interpret the JS. Locally, your phantomjs might be able to work with ES6, but the default version on Circle may not.


#3