0

while react component testing I'am facing this issue and I don't understand how can i solve this issue. I have added all the necessary elements but still facing this issueenter image description here

I'am trying to check react component testing but still facing an unexpected issue...

1 Answers1

0

The error points that you are using a import statement outside a module , because import statements are only supported in modules in js. So this can be solved by 2 ways.

  1. In your package.json file , add type=module as below :

{

 // ...

 "type": "module",

 // ...

}
  1. Replace all your import statements with require.
Arun
  • 118
  • 5