Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enzyme break after React upgrade from 15.0.0-rc2 to 15.0.1 #325

Closed
nehaleem opened this issue Apr 15, 2016 · 7 comments · Fixed by #338
Closed

Enzyme break after React upgrade from 15.0.0-rc2 to 15.0.1 #325

nehaleem opened this issue Apr 15, 2016 · 7 comments · Fixed by #338

Comments

@nehaleem
Copy link

nehaleem commented Apr 15, 2016

We are using enzyme to test our React components together with browserify.
But after upgrade React from rc2 to stable 15.0.1:

If i'll run tests, i'll get this error:
Error: Cannot find module 'react/addons' from '/myproject/node_modules/enzyme/build

But installed version is 15.0.1 (React.version) which is using module react-addons-test-utils
If i'll remove this line:
TestUtils = require('react/addons').addons.TestUtils;
from build\react-compat.js its works properly.

Package.json:

"dependencies": {
    "react": "15.0.1",
    "react-addons-perf": "15.0.1",
    "react-addons-test-utils": "15.0.1",
    "react-addons-update": "15.0.1",
    "react-dom": "15.0.1"
  },
  "devDependencies": {
    "babel-core": "^6.7.0",
    "babel-plugin-external-helpers-2": "^6.3.13",
    "babel-plugin-transform-decorators-legacy": "^1.3.4",
    "babel-polyfill": "^6.3.14",
    "babel-preset-es2015": "^6.6.0",
    "babel-preset-react": "^6.5.0",
    "babel-preset-stage-0": "^6.5.0",
    "babelify": "^7.2.0",
    "browserify": "^13.0.0",
    "enzyme": "^2.2.0",
    "watchify": "^3.7.0"
  }
@JakubBarta
Copy link

same problem here

@jodal
Copy link

jodal commented Apr 19, 2016

I believe this was fixed by commit 77e6bdc. I have the same issue with v2.2.0, but it works when running master. Would be nice with an Enzyme release which works with React 15.

@ljharb
Copy link
Member

ljharb commented Apr 19, 2016

That commit shouldn't have been able to impact anything, unless you're relying on npm 2 implicitly installing peer deps?

@jodal
Copy link

jodal commented Apr 19, 2016

Ok, that might not be the fix then. A release that works with React 15 out of the box is still wanted though :-)

@ljharb
Copy link
Member

ljharb commented Apr 19, 2016

The latest release is already that. The only difference is potentially a peer dep warning.

We'll try to cut a release soon.

dannynelson pushed a commit to goodeggs/enzyme that referenced this issue Apr 20, 2016
dannynelson pushed a commit to goodeggs/enzyme that referenced this issue Apr 20, 2016
dannynelson pushed a commit to goodeggs/enzyme that referenced this issue Apr 20, 2016
lelandrichardson pushed a commit that referenced this issue Apr 21, 2016
@nehaleem
Copy link
Author

Guys, can you please release new version ?, this commit would be great :)

@ljharb
Copy link
Member

ljharb commented Apr 29, 2016

@nehaleem enzyme already works fine with React 15. The commit you're referencing is just documentation.

dustinsanders pushed a commit to dustinsanders/enzyme that referenced this issue Apr 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants