can not find module 'react-addon-test-utils' from 'node_modules/enzyme/build'
See original GitHub issueOur project is using :
React: ^15.5.4
react-dom: ^15.5.4
react-test-renderer: ^15.5.4
according to airbnb/enzyme website, If you are using React >=15.5, in addition to enzyme, you will have to ensure that you also have the react-dom
and react-test-renderer
npm modules installed, we already installed these npm modules, only that in React 0.14 or React <15.5 need to install the react-addons-test-utils
.
when we use enzyme to test our react component, there is a problem:
can not find module 'react-addon-test-utils' from 'node_modules/enzyme/build'
.
If we install the module ‘react-addon-test-utils’, then the test is OK, but our React >=15.5, Why we need to install the react-addon-test-util
?
Anybody has solution to this problem? Thanks~
Issue Analytics
- State:
- Created 6 years ago
- Reactions:10
- Comments:12 (7 by maintainers)
Top Results From Across the Web
ReflectionTestUtils (Spring Framework 6.0.3 API)
This method delegates to setField(Object, Class, String, Object, Class) , supplying null for the targetObject and type arguments. This method does not support ......
Read more >Guide to ReflectionTestUtils for Unit Testing - Baeldung
Learn how to use ReflectionTestUtils in unit testing by going through several examples.
Read more >java - Use of ReflectionTestUtils.setField() in Junit testing
In your test class, you cannot set an id of your entity because of the missing setter method. Using ReflectionTestUtils.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@ljharb same situation here,
and getting:
I’m also able to directly require
react-dom/test-utils
andreact-test-rendered/shallow
.In my case, I’m using
karma
withkarma-webpack
.Adding this to my webpack config removed the warnings:
As per @rafaelkallis in my Karma configuration (non-webpack) I added
to my karma.conf.js
This solved the problem for me