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
Babel plugin missing after upgrading to v3 #1176
Comments
sigh. this is from react native's terrible behavior of transpiling node_modules. This is probably indicative of us now not npm ignoring our .babelrc file, whereas we used to before. In the short term, you might be able to configure jest to ignore certain modules... i don't remember how to do that but some googling might uncover something. Or you can just manually delete the babelrc in enzyme and enzyme-adapter-react-16 node_modules folders. |
@lelandrichardson thanks for your fast response. You mean this:
Probably? Uhm manually deleting doesn't seem an option for teams I believe. |
@Fatxx manually deleting is fine if you do it as a postinstall script; if RNP still is broken and babel-transpiles |
Uhm I see, as @skovhus pointed out here: #928 (comment) |
@Fatxx for reference, airbnb does the following in our react native code base in a postinstall script:
super hacky, but the bug lies with react native, not with enzyme... although I will consider adding the babelrcs to the npmignore in the next release anyway in order to make consuming enzyme easier for people. |
Yeah adding the following to your package.json does the trick (for now)...
But seems this might have been fixed in newer version of react-native... Haven't tested this. |
going to place the v3 bugs label back on this issue. I don't think this was an expected difference between v2 and v3, though calling it a "bug" is a bit of a stretch, it's still something i'd like to fix on our end so this label will remind me. |
@lelandrichardson that script worked! @skovhus. Thank you both 👍 |
Having this issue also using karma testrunner, and the script mentioned above does not work. |
This is hopefully fixed in |
While executing tests using jest I'm facing the following error after upgrade to v3:
ReferenceError: Unknown plugin "transform-replace-object-assign" specified in "${pathToProject}/node_modules/enzyme/.babelrc" at 0, attempted to resolve relative to "${pathToProject}/node_modules/enzyme"
package.json:
setupTests.js:
Anyone facing this or any clue how to solve it?
The text was updated successfully, but these errors were encountered: