Hello everyone!
While trying to execute tests in my project I get the following error:
Cannot find module 'react-dom' from 'react-compat.js'
My environment is as follows:
"react": "^15.4.2","react-addons-test-utils": "^15.4.2","jest": "18.1.0","react-native": "0.40.0","enzyme": "^2.7.1",In my test file I have imports in the following order:
import * as React from 'react';
import 'react-native';
import { shallow } from 'enzyme';
I've read common problems and tried to search through issues, but haven't found anything. Sorry if I missed something.
You also need react-dom installed, even if you're not using it.
@ljharb thank you for blazingly fast answer!
That solved an issue. It seems like it's worth mentioning in the React Native setup guide.
Most helpful comment
You also need
react-dominstalled, even if you're not using it.