Skip to content

Commit 450e750

Browse files
committed
[v13] chore: increase required React et al. versions
1 parent b5cfb98 commit 450e750

File tree

4 files changed

+15
-36
lines changed

4 files changed

+15
-36
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@
5757
},
5858
"peerDependencies": {
5959
"jest": ">=28.0.0",
60-
"react": ">=18.2.0",
61-
"react-native": ">=0.73",
62-
"react-test-renderer": ">=18.2.0"
60+
"react": ">=18.3.0",
61+
"react-native": ">=0.75",
62+
"react-test-renderer": ">=18.3.0"
6363
},
6464
"peerDependenciesMeta": {
6565
"jest": {

website/docs/12.x/docs/api/misc/async.mdx

-14
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,6 @@ Avoiding side effects in `expectation` callback can be partially enforced with t
5353

5454
It is also recommended to have a [single assertion per each `waitFor`](https://kentcdodds.com/blog/common-mistakes-with-react-testing-library#having-multiple-assertions-in-a-single-waitfor-callback) for more consistency and faster failing tests. If you want to make several assertions, then they should be in seperate `waitFor` calls. In many cases you won't actually need to wrap the second assertion in `waitFor` since the first one will do the waiting required for asynchronous change to happen.
5555

56-
### Using a React Native version < 0.71 with Jest fake timers
57-
58-
:::caution
59-
When using a version of React Native < 0.71 and modern fake timers (the default for `Jest` >= 27), `waitFor` won't work (it will always timeout even if `expectation()` doesn't throw) unless you use the custom [@testing-library/react-native preset](https://github.com/callstack/react-native-testing-library#custom-jest-preset).
60-
:::
61-
6256
`waitFor` checks whether Jest fake timers are enabled and adapts its behavior in such case. The following snippet is a simplified version of how it behaves when fake timers are enabled:
6357

6458
```tsx
@@ -96,10 +90,6 @@ await waitFor(() => {
9690
}, 10000);
9791
```
9892

99-
:::info
100-
In order to properly use `waitFor` you need at least React >=16.9.0 (featuring async `act`) or React Native >=0.61 (which comes with React >=16.9.0).
101-
:::
102-
10393
:::note
10494
If you receive warnings related to `act()` function consult our [Undestanding Act](docs/advanced/understanding-act.md) function document.
10595
:::
@@ -129,10 +119,6 @@ This method expects that the element is initially present in the render tree and
129119

130120
You can use any of `getBy`, `getAllBy`, `queryBy` and `queryAllBy` queries for `expectation` parameter.
131121

132-
:::info
133-
In order to properly use `waitForElementToBeRemoved` you need at least React >=16.9.0 (featuring async `act`) or React Native >=0.61 (which comes with React >=16.9.0).
134-
:::
135-
136122
:::note
137123
If you receive warnings related to `act()` function consult our [Undestanding Act](docs/advanced/understanding-act.md) function document.
138124
:::

website/docs/MigrationV13.md renamed to website/docs/12.x/docs/migration/v13.mdx

+9-16
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
id: migration-v13
2-
title: Migration to 13.0
3-
4-
---
5-
6-
import TOCInline from '@theme/TOCInline';
1+
# Migration to 13.0
72

83
Migration to React Native Testing Library version 13 from version 12.x.
94

10-
<TOCInline toc={toc} />
11-
125
# Breaking changes
136

147
## Supported React and React Native versions
@@ -23,11 +16,11 @@ This deprecated query has been removed as is typically too general to give meani
2316

2417
- [`*ByRole`](#by-role) query with relevant state options: `disabled`, `selected`, `checked`, `expanded` and `busy`
2518
- use built-in Jest matchers to check the state of element found using some other query:
26-
- enabled state: [`toBeEnabled()` / `toBeDisabled()`](jest-matchers#tobeenabled)
27-
- checked state: [`toBeChecked()` / `toBePartiallyChecked()`](jest-matchers#tobechecked)
28-
- selected state: [`toBeSelected()`](jest-matchers#tobeselected)
29-
- expanded state: [`toBeExpanded()` / `toBeCollapsed()`](jest-matchers#tobeexpanded)
30-
- busy state: [`toBeBusy()`](jest-matchers#tobebusy)
19+
- enabled state: [`toBeEnabled()` / `toBeDisabled()`](docs/api/jest-matchers#tobeenabled)
20+
- checked state: [`toBeChecked()` / `toBePartiallyChecked()`](docs/api/jest-matchers#tobechecked)
21+
- selected state: [`toBeSelected()`](docs/api/jest-matchers#tobeselected)
22+
- expanded state: [`toBeExpanded()` / `toBeCollapsed()`](docs/api/jest-matchers#tobeexpanded)
23+
- busy state: [`toBeBusy()`](docs/api/jest-matchers#tobebusy)
3124

3225
```ts
3326
// Replace this
@@ -45,7 +38,7 @@ expect(view).toBeDisabled(); // Assert its accessibility state
4538

4639
This deprecated query has been removed as is typically too general to give meaningful results. Use one of the following options:
4740

48-
- [`toHaveAccessibilityValue()`](jest-matchers#tohaveaccessibilityvalue) Jest matcher to check the state of element found using some other query
41+
- [`toHaveAccessibilityValue()`](docs/api/jest-matchers#tohaveaccessibilityvalue) Jest matcher to check the state of element found using some other query
4942
- [`*ByRole`](#by-role) query with `value` option
5043

5144
```ts
@@ -62,7 +55,7 @@ expect(view).toHaveAccessibilityValue({ now: 50, min: 0, max: 50 }); // Assert i
6255

6356
## Removed `debug.shallow`
6457

65-
For a time being we didn't support shallow rendering. Now we are removing the last remains of it: `debug.shallow()`. If you are interested in shallow rendering see [here](migration-v2#removed-global-shallow-function).
58+
For a time being we didn't support shallow rendering. Now we are removing the last remains of it: `debug.shallow()`. If you are interested in shallow rendering see [here](docs/migration/previous/v2#removed-global-shallow-function).
6659

6760
# Other changes
6861

@@ -72,4 +65,4 @@ This should not break any tests.
7265

7366
## Full Changelog
7467

75-
https://github.com/callstack/react-native-testing-library/compare/v12.5.0...v13.0.0
68+
https://github.com/callstack/react-native-testing-library/compare/v12.5.2...v13.0.0

yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -2931,9 +2931,9 @@ __metadata:
29312931
typescript: "npm:^5.5.4"
29322932
peerDependencies:
29332933
jest: ">=28.0.0"
2934-
react: ">=18.2.0"
2935-
react-native: ">=0.73"
2936-
react-test-renderer: ">=18.2.0"
2934+
react: ">=18.3.0"
2935+
react-native: ">=0.75"
2936+
react-test-renderer: ">=18.3.0"
29372937
peerDependenciesMeta:
29382938
jest:
29392939
optional: true

0 commit comments

Comments
 (0)