I’m happy to announce a new testing library to help you write better React Native tests with less effort. react-native-testing-library 🎉🎉🎉 It’s like react-testing-library but tailored for RN and universal React apps. Happy testing! 🙃 github.com/callstack/react-n…

Oct 11, 2018 · 1:08 PM UTC

8
83
285
It is designed to test any React app, as it builds on top of react-test-renderer. Its purpose is to put an end to testing implementation details of your components and test public APIs and their integration.
1
7
I'd like to thank @esemesek for helping to shape the lib and of course kudos to @kentcdodds for his react-testing-library which was an inspiration to write this.
1
7
Sort replies: Relevant Recent Liked
Replying to @thymikee
While it is awesome to see more tooling for @reactnative, FYI Enzyme can use deep rendering with React Native and jsdom, though your README mentions only allowing shallow rendering. (Ironically I just got Enzyme working with mount() this morning before seeing this announcement)
1
1
Yup, but I don't want to use jsdom as RN is not web. Also Enzyme makes it too easy to write bad tests that assert on implementation details. I've seen just enough of it 😉
1
3
Lol apparently this is not appropriate.
2
Replying to @thymikee
Looks awesome! 👏👊
1
Replying to @thymikee
Very good job, man. When I was checking how to test React Apps with react-testing-library. I saw that it wasn't covering the RN stuff as other libraries do. Glad to hear that there's an implementation for RN now :D
1
Replying to @thymikee
@xtrycatchblockx May be of interest to you :)