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

Fix documentation for React Native #1375

Open
Parasrah opened this issue Nov 21, 2017 · 5 comments
Open

Fix documentation for React Native #1375

Parasrah opened this issue Nov 21, 2017 · 5 comments

Comments

@Parasrah
Copy link

Description

The documentation instructs users to install react-native-mock, which does not work with more recent versions of react due to it's usage of a deprecated API

Proposal

I'm not really sure what the appropriate solution for this is, whether to add a footnote to the documentation regarding recent versions of react-native/react, or finding a more reliable library/solution for the problem.

Thanks for the awesome utility! You've made a lot of lives easier! 🥇

@iwilsonq
Copy link

+1

I 'm using Expo to setup a React Native app but I want to be able to use Enzyme to help me with testing rather than react-test-renderer. I'm having difficulty setting this up and it looks like react-native-mock is not compatible with recent versions of RN?

@ljharb
Copy link
Member

ljharb commented Jul 6, 2018

You'd need a react native adapter to use enzyme with React Native.

The docs should be updated; in the meantime, please follow #1436.

@shawnaxsom
Copy link
Contributor

I can help with the docs here. I have React Native working with Enzyme, and actually with deep rendering with mount() too using jsdom. I didn't have to use react-native-mock or react-native-mock-renderer to get it to work (and those solutions made the DOM and snapshots harder to read so I wouldn't recommend them).

I'm assuming it should work with Expo also @iwilsonq, let me know if you still need help getting Enzyme to work.

@shawnaxsom
Copy link
Contributor

We opened sourced our boilerplate project where I have Enzyme set up with React Native, if anyone wants an example to look at:

React Native mobile boilerplate with Enzyme

Relevant files in the repo for Jest / Enzyme:

@shawnaxsom
Copy link
Contributor

Documentation PR #1873 is up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants