Jest: } catch { ^ SyntaxError: Unexpected token {

Created on 15 Jun 2020  路  2Comments  路  Source: facebook/jest

Hello,
Whilst writing unit test to reconfigure the url using jsdom.reconfigure I had to install jest-environment-jsdom & jest-environment-jsdom-global @latest.

Once I installed and configured the Jest.config with testEnvironment: "jest-environment-jsdom-global" I'm getting this wired issue:
image

Interesting thing, is seeing the issue I tried to fix it by going into the file node_modules\jsdom\node_modules\webidl-conversions\lib\index.js and fix it as catch(e) { ... } where I couldn't find the line as thrown!

Node version v8.11.2
OS: Win 10

Bug Report Needs Repro Needs Triage

Most helpful comment

Jest 26 doesn't support node 8, you need to use node 10+

All 2 comments

I got the same error.
to solve by upgrade node version to 1x +.

Jest 26 doesn't support node 8, you need to use node 10+

Was this page helpful?
0 / 5 - 0 ratings