Closed tugorez closed 7 years ago
I believe this is caused by React 15.5 changing the location of the react-test-utils to react-dom/test-utils
. Meanwhile, enzyme's package.json file allows for 15.5 to be used.
Edit: If I am correct, #637 might be tangentially related.
Also, see #892 and #876.
I have the same issue
I have this in my package.json
"devDependencies": {
"babel-eslint": "^4.1.0",
"chai": "^2.3.0",
"deep-freeze": "0.0.1",
"enzyme": "^2.8.2",
"grunt": "~0.4.4",
"grunt-browserify": "^4.0.0",
"grunt-cli": "^0.1.13",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^1.0.0",
"grunt-contrib-cssmin": "^0.7.0",
"grunt-contrib-less": "~0.9.0",
"grunt-contrib-uglify": "^0.6.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-eslint": "^17.1.0",
"grunt-mocha-test": "^0.12.7",
"jshint": "~2.4.4",
"mocha": "^2.2.4",
"mocha-teamcity-reporter": "0.0.2",
"neo-browserify-exports": "^1.3.2",
"neo-browserify-mold-sourcemap": "^1.0.4",
"neo-core-css": "^1.6.4",
"neo-core-js": "^0.4.0",
"react-addons-perf": "0.14.2",
"react-addons-test-utils": "^0.14.8",
"reactify": "1.1.1",
"stringify": "^3.1.0",
"websdk-colours": "1.0.x"
},
"dependencies": {
"common-logger": "^1.0.2",
"d3": "^3.5.5",
"immutable": "3.7.6",
"lodash": "4.15.0",
"moment": "2.11.2",
"moment-timezone": "^0.5.11",
"numeral": "1.5.3",
"q": "2.0.3",
"react": "0.14.8",
"react-component-wrapper": "1.0.4",
"react-dom": "0.14.6",
"react-redux": "4.0.0",
"react-truncate": "^2.0.5",
"redux": "3.0.4",
"redux-thunk": "1.0.0",
"shims": "0.0.x",
"uuid": "^3.0.1"
},
and i am getting error Error: Cannot find module 'react-dom/test-utils'
Any pointer is highly appreciated.
Bump react-dom to 0.14.8? All the react-* things need to be the same version.
I find solution. You are missing npm package. Go to cmd and type yarn add react-addons-test-utils Hope it helps. ;)
@matijastampfel we're not missing it. It's part of the instructions for React < 15.5.
I just bumped into this and seeing it with React > 15.5
"enzyme": "^2.8.2",
"react": "^15.6.0",
"react-a11y": "^0.3.4",
"react-addons-perf": "^15.4.2",
"react-docgen": "^3.0.0-beta4",
"react-dom": "^15.6.0",
"react-test-renderer": "^15.5.4",
yarn list react-dom update-dependencies ✭
yarn list v0.24.6
└─ react-dom@15.6.0
@rosskevin just to confirm; even if you update react-test-renderer
to 15.6 (since, generally, all react-* packages always need to be on the same minor), you still see the problem?
@ljharb that was the most current as of 18 hours ago. Confirmed fixed now with updated packages released ~14 hours ago:
react ^15.6.0 → ^15.6.1
react-dom ^15.6.0 → ^15.6.1
react-test-renderer ^15.5.4 → ^15.6.1
Thanks, looks like this is resolved (and that the react team may need to coordinate more timely release of their packages ;-) )
(Happy to reopen if this problem is continuing to occur for anyone; also, filing a new issue would be great too!)
Hi, Jest is a great library. But when trying run my tests with all three packages bumped up to version 16.3.1, it is giving me the same error "Cannot find module 'react-addons-test-utils' from 'react-compat.js'. Can someone please help me with resolving the same? below is my package.json
Hi guys, thank you for such a nice library :)
I just created a react-native project today but when I try to run a test, this error message appears
package.json
index.js
index.test.js