Closed salarmiirzaeie closed 7 months ago
We updated React-Redux's packaging in v9, and it should be using ESM modules by default. Our tests show it should work with Jest. If you have a specific issue, please provide a repo that shows this error happening so we can investigate.
I created a repo : https://github.com/salarmiirzaeie/react-redux-jest/tree/main
You don't have babel-jest
hooked up correctly. Add this to your jest.config.js:
"transform": {
"\\.[jt]sx?$": "babel-jest"
},
You don't have
babel-jest
hooked up correctly. Add this to your jest.config.js:"transform": { "\\.[jt]sx?$": "babel-jest" },
I have the same problem. Adding this to config doesn't help
What version of React, ReactDOM/React Native, Redux, and React Redux are you using?
What is the current behavior?
When we was trying test components using jest and redux in react-native, it said "SyntaxError: Cannot use import statemen outside a module" where we used Provider from react-redux in version 9.1.0 but in react-redux version 8.1.3 it was passed in jest
What is the expected behavior?
It should pass in version 9.1.0 like other version like v 8.13
Which browser and OS are affected by this issue?
No response
Did this work in previous versions of React Redux?