Tried all of the above and using a brand new empty project with nothing but the sum getting started code.
Do you want to request a _feature_ or report a _bug_?
Bug
What is the current behavior?
When running npm test, I get the following:
FAIL ./sum.test.js
โ Test suite failed to run
SyntaxError: Unexpected token {
at _load_jsdom (node_modules/jest/node_modules/jest-cli/node_modules/jest-environment-jsdom/build/index.js:17:41)
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can yarn install and yarn test.
this is where I get the error:
SyntaxError: Unexpected token {
at _load_jsdom (node_modules/jest/node_modules/jest-cli/node_modules/jest-environment-jsdom/build/index.js:17:41)
Sorry I do not have time for repl, but this could make or break my fortune 100 (Sorry, cannot disclose publicly) company's adoption of using this.
@jpmock running into the same issue. did you solve?
Answered my own question: the jest dependency jest-environment-jsdom is by default incompatible with node versions < 10. To fix, add the following to your jest config in package.json:
"jest": {
"testEnvironment": "node",
...other config
},
Most helpful comment
Answered my own question: the jest dependency
jest-environment-jsdomis by default incompatible with node versions < 10. To fix, add the following to your jest config in package.json: