-
Notifications
You must be signed in to change notification settings - Fork 46.4k
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
react-test-renderer cannot find the render function of the react-native component #13399
Comments
Hmm, after a lot of searching I found this #13182
and create a simple component with just a render function that returns and run the test for it but the render function was there, no error was thrown
|
I've had the same problem. after upgrading react-native from 0.55.4 to 0.56.0, my tests won't run. I've done a lot of digging and debugging and found that class components ( Removing Still unsure what's going on. |
Sorry — there's nothing we can help you with in the React repository. As I already said in #13182 (comment), this issue is not caused by React. If you define a class and a method on it doesn't work, it's a problem with your transformation pipeline. I don't know if it's a problem with |
Most likely the best place to file this issue is React Native repository because the issue is likely related to their Babel 7 upgrade. There might be some version mismatch related to the Babel preset. |
I looked at the reproducing example in https://github.com/getmaple/TestApp56 again.
In particular, the issue was that the project mistakingly pulled in Check your Hope this helps! |
Sorry, just came online. |
thanks for the tip Dan - it doesn't seem to work in my case unfortunately. I've created an issue over at |
this breaks when i upgrade test renderer from 16.4.2 to 16.5.1. I am also using react native, but I don't think it has anything to do with that. |
@PhoenixRe32 have you resolved this issue? |
Do you want to request a feature or report a bug?
A bug
What is the current behavior?
When I run my tests and I render my component (using the shallow function of Enzyme) it fails because it can't find the render function.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
I am developing a react-native application.
I am running the default jest command to run the tests and this happens.
I can't reproduce it in a small project.
What is the expected behavior?
It should run the tests
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
I am using:
"@babel/core": "^7.0.0-beta.47",
"prop-types": "15.6.2",
"react": "16.4.1",
"react-dom": "16.4.2",
"react-native": "0.56.0",
"@babel/core": "^7.0.0-beta",
"babel-core": "^7.0.0-beta",
"babel-jest": "23.4.2",
"babel-preset-react-native": "5.0.2",
"babel-runtime": "^7.0.0-beta",
"enzyme": "3.4.1",
"enzyme-adapter-react-16": "1.2.0",
"jest": "23.5.0 ",
"jest-fetch-mock": "1.6.5",
"jsdom": "11.12.0",
"react-test-renderer": "16.4.1",
My jest configuration is in jest.config.js
and my babel config in babel.config.js
The text was updated successfully, but these errors were encountered: