React-GA + Redux V7 Incompatibility Issue With Jest
I am using react-ga
v2.5.7, for which I updated react-redux
v7.0.2, and I am using jest
v24.7.1
I set react-ga
in testMode
, and it is mocked in my jest.setup.js
. But everytime I run my tests I am always encountering the same issue, most of the tests are failing for some weird reason:
Test suite failed to run
Cannot find module '@icons/material/CheckIcon' from 'SwatchesColor.js'
However, Jest was able to find:
'./SwatchesColor.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
However, Jest was able to find:
'./SwatchesGroup.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
However, Jest was able to find:
'components/swatches/Swatches.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
However, Jest was able to find:
'./VisualIdentityColorPicker.js'
'./VisualIdentityColorPicker.spec.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
However, Jest was able to find:
'./VisualIdentityBackgroundSelector.js'
'./VisualIdentityBackgroundSelector.spec.js'
You might want to include a file extension in your import, or update your 'moduleFileExtensions', which is currently ['js', 'json', 'jsx', 'ts', 'tsx', 'node'].
See https://jestjs.io/docs/en/configuration#modulefileextensions-array-string
Though SwatchesColors is a dependency of a module completely unrelated.
I seems to me that there is an incompatibility issues and the only things that have changed in my project are the addition of react-ga
and the update of react-redux
, as anyone encounter a similar issue ?
How did you solved it ?
Answer
I found the actual issue, it seem to be related to a component not import that was causing a strange behaviour in the tests.
Once I imported it, the issues disappeared.
Related Questions
- → Import statement and Babel
- → should I choose reactjs+f7 or f7+vue.js?
- → Uncaught TypeError: Cannot read property '__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED' of undefined
- → .tsx webpack compile fails: Unexpected token <
- → React-router: Passing props to children
- → ListView.DataSource looping data for React Native
- → React Native with visual studio 2015 IDE
- → Can't test submit handler in React component
- → React + Flux - How to avoid global variable
- → Webpack, React & Babel, not rendering DOM
- → How do I determine if a new ReactJS session and/or Browser session has started?
- → Alt @decorators in React-Native
- → How to dynamically add class to parent div of focused input field?