I'm using mocha
for unit tests and trying to use jsdom
for html
elements on my unit tests.
I downloaded the jsdom.zip
and imported the library for my tests, and get stuck on this error:
jsdom/living/attributes.js:114 for (const name of Object.getOwnPropertyNames(prototype)) { ^^ SyntaxError: Unexpected identifier
I tried to find the cause of this error message on Google but unfortunately I wasn't able to find an answer.
The latest JSDOM does not work with older versions of Node (the syntax error is probably the ES6
const
). As the readme says:Try upgrading to latest Node or downloading version 3.x (also, NPM might make this much easier than downloading ZIP files :)