From 9bb213e4a6c2bbe3245d1721b3d56a87990c046e Mon Sep 17 00:00:00 2001 From: pierrezimmermann Date: Tue, 21 Feb 2023 10:27:23 +0100 Subject: [PATCH 1/3] docs: update migration guide to mention updating version of jest native --- website/docs/MigrationV12.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/MigrationV12.md b/website/docs/MigrationV12.md index 7f556aa7a..cef5746fe 100644 --- a/website/docs/MigrationV12.md +++ b/website/docs/MigrationV12.md @@ -56,6 +56,8 @@ Historically `container` was supposed to mimic the [RTL's container](https://tes 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. +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. + # Full Changelog https://github.com/callstack/react-native-testing-library/compare/v11.5.2...v11.5.2...v12.0.0-rc.0 From fa2c87e7e22c71d0e75719bfa6a52e55e63411da Mon Sep 17 00:00:00 2001 From: pierrezimmermann Date: Tue, 21 Feb 2023 12:40:52 +0100 Subject: [PATCH 2/3] docs: add note at top level to indicate it requires an update of jest native --- website/docs/MigrationV12.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/website/docs/MigrationV12.md b/website/docs/MigrationV12.md index cef5746fe..c8fc9b26c 100644 --- a/website/docs/MigrationV12.md +++ b/website/docs/MigrationV12.md @@ -5,6 +5,10 @@ title: Migration to 12.0 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. +:::note +If you also use [@testing-library/jest-native](https://github.com/testing-library/jest-native) then you should upgrade it to version 5.4.2 or higher. +::: + # Breaking changes ## 1. All queries exclude elements hidden from accessibility by default @@ -56,7 +60,7 @@ Historically `container` was supposed to mimic the [RTL's container](https://tes 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. -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. +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. # Full Changelog https://github.com/callstack/react-native-testing-library/compare/v11.5.2...v11.5.2...v12.0.0-rc.0 From 9e3ea55c44829305be585966667837531b3119ee Mon Sep 17 00:00:00 2001 From: Maciej Jastrzebski Date: Tue, 21 Feb 2023 14:17:17 +0100 Subject: [PATCH 3/3] Update website/docs/MigrationV12.md --- website/docs/MigrationV12.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/MigrationV12.md b/website/docs/MigrationV12.md index c8fc9b26c..21661679f 100644 --- a/website/docs/MigrationV12.md +++ b/website/docs/MigrationV12.md @@ -6,7 +6,7 @@ title: Migration to 12.0 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. :::note -If you also use [@testing-library/jest-native](https://github.com/testing-library/jest-native) then you should upgrade it to version 5.4.2 or higher. +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. ::: # Breaking changes