I am getting the following error:
PhantomJS 2.1.1 (Windows 7 0.0.0) ERROR
SyntaxError: Unexpected token '>'
at myAngularControllerPath.js:9
Navigating to that file I find that I am using the Array.some() function like so:
return list.some(x => isListItemGood(x));
When I run Karma with Chrome specified in the karma.conf.js file I do not get this error.
According to http://kangax.github.io/compat-table/es5/ , PhantomJS support all 10 new array features of ES5 and Array.some() was introduced in ES5 according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some. I installed PhantomJS using 'npm install --save-dev karma-phantomjs-launcher' which has 2.1.7 listed as the PhantomJS version in its dependencies.
Thank you for any and all help!
"Arrow functions" are not supported by PhantomJS 2.x
PhantomJS only supports a small subset of ES6.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With