You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* docs: update migration guide to mention updating version of jest native
* docs: add note at top level to indicate it requires an update of jest native
* Update website/docs/MigrationV12.md
---------
Co-authored-by: pierrezimmermann <pierrez@nam.tech>
Copy file name to clipboardExpand all lines: website/docs/MigrationV12.md
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,10 @@ title: Migration to 12.0
5
5
6
6
React Native Testing Library 12 introduces a handful of breaking changes compared to 11.x versions. We believe they were necessary to improve the experience using the library and help the users [fall into the pit of success](https://blog.codinghorror.com/falling-into-the-pit-of-success/) when writing meaningful tests. You will find migration instructions for each and every change described below.
7
7
8
+
:::note
9
+
If you use [Jest Native matchers](https://github.com/testing-library/jest-native), which we recommend, then you should upgrade it to version 5.4.2 or higher.
10
+
:::
11
+
8
12
# Breaking changes
9
13
10
14
## 1. All queries exclude elements hidden from accessibility by default
@@ -56,6 +60,8 @@ Historically `container` was supposed to mimic the [RTL's container](https://tes
56
60
57
61
RNTL v12 introduces `root` API as an alternative that returns a root **host** element. The difference between `root` and `UNSAFE_root` properties is that that `root` will always represents a host element, while `UNSAFE_root` will typically represent a composite element.
58
62
63
+
If you use `toBeOnTheScreen` matcher from [@testing-library/jest-native](https://github.com/testing-library/jest-native) your tests will fail because it uses the `container` api. To fix this, update `@testing-library/jest-native` to version 5.4.2.
0 commit comments