Quantcast
Channel: "SyntaxError: Cannot use import statement outside a module" error while testing React Native project with Jest and @testing-library/react-native? - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Thilina Chamika for "SyntaxError: Cannot use import statement outside a module" error while testing React Native project with Jest and @testing-library/react-native?

$
0
0

[Solved] Work for meInstall below

npm install --save-dev @babel/core @babel/preset-env

after that create the "babel.config.js" file in the root and that content should be as below

module.exports = {  presets: ['@babel/preset-env', '@babel/preset-react'],  env: {    test: {      plugins: ["@babel/plugin-transform-runtime"]    }  }};

Viewing all articles
Browse latest Browse all 3

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>