-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Error when mounting React Native component #614
Comments
mount requires a document be available - either because it's in a browser, or via jsdom. |
It was working with jest 12 tho. What was I doing wrong? |
You can try |
The reason i've choosen Enzyme with Jest is because i can access the instance and the inner functions of my components. This is not possible with react-test-renderer. |
Yeah, we need to implement the |
Are you planning to implement |
@Rewieer Could you explain why this isn't possible with |
@khirakawa it's been quite a long time since then, but it seems at the time react-test-renderer hadn't a getInstance method. |
I've tried to do the "testEnvironment": "jsdom" in package.json (no change) in my jestConfig.json file (lots of unknown prop errors. Maybe progress?). Has anyone figured out a way to use Enzyme's mounting for testing events with React Native and Jest? |
shallow(<MyComponent store={store} />).dive().instance() works for redux
|
You'd need a react native adapter to use enzyme with React Native. Closing this in favor of #1436. |
I am using Jest. Shallow works fine. When i try to mount a component i get this error:
This is the test (RecommendationsList is basic component with just 1 View):
Part of package.json:
The text was updated successfully, but these errors were encountered: