Skip to content

Commit d3146aa

Browse files
shawnaxsomthymikee
authored andcommitted
docs: Documentation update for The Problem section of the README, clarifying Enzyme capabilities while highlighting more react-native-testing-library benefits (#43)
1 parent 2c68384 commit d3146aa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ _Appreciation notice: This project is heavily inspired by [react-testing-library
1313

1414
## The problem
1515

16-
You want to write maintainable tests for your React Native components without testing implementation details, but then you're told to use Enzyme, which only supports shallow rendering in React Native environment. And you want to render deep! But doing so with `react-test-renderer` is so painful.
16+
You want to write maintainable tests for your React Native components without testing implementation details, but then you're told to use Enzyme, which you learn has no React Native adapter, meaning only shallow rendering is supported. And you want to render deep! But deep rendering may otherwise require jsdom (React Native isn't the web!), while doing deep rendering with `react-test-renderer` is so painful.
1717

1818
You would also like to use the newest React features, but you need to wait for your testing library's abstractions to catch up and it takes a while.
1919

20+
You finally want to approach testing using only best practices, while Enzyme may encourage assertions on implementation details.
21+
2022
## This solution
2123

2224
The `react-native-testing-library` is a lightweight solution for testing your React Native components. It provides light utility functions on top of `react-test-renderer` letting you always be up to date with latest React features and write any component tests you like, be it shallow or deeply rendered ones. But really not any, it prevents you from testing implementation details because we stand this is a very bad practice.

0 commit comments

Comments
 (0)