Jest: Must use import to load ES Module

Viewed 86

I'm trying to configure jest/babel to do react component testing in my app. So far I'm facing some difficulties, in imports. It throws this error: Reference

Here is my babel.config.json:

{
  "plugins": [
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-transform-runtime"
  ],
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "node": "current"
        }
      }
    ],
    "@babel/preset-react"
  ]
}

I've trying adding "type": "module" in the package.json and it brings different problems upon itself. I would appreciate any help!

0 Answers
Related