diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..1a43137ce --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,92 @@ +# Changelog + +All notable changes to React Native Testing Library will be documented in this file, starting +with v14. + +## 14.0.0 + +### Migration guide + +See the [Migration to 14.x](./website/docs/14.x/docs/start/migration-v14.mdx) guide for +step-by-step upgrade instructions, codemods, and before/after examples. + +### Breaking changes + +- Dropped support for React 18. React 19.0.0 or newer is now required. +- Raised the minimum supported React Native version to 0.78. +- Raised the minimum supported Node.js version to `^22.13.0 || >=24`. +- Replaced the deprecated React Test Renderer with + [Test Renderer](https://github.com/mdjastrzebski/test-renderer). +- Added a peer dependency on Test Renderer 1.x. Install the Test Renderer compatibility line + that matches your React 19 minor version. +- Made the core rendering and event APIs async by default: + - `render()` now returns `Promise`. + - `renderHook()` now returns `Promise`. + - `fireEvent()` and its helpers now return `Promise`. + - `act()` now always returns a Promise and should always be awaited. +- Removed the `renderAsync`, `renderHookAsync`, and `fireEventAsync` APIs. Use `render`, + `renderHook`, and `fireEvent` instead. +- Removed the `update` alias. Use `rerender` instead. +- Removed the `getQueriesForElement` alias. Use `within` instead. +- Removed `UNSAFE_root`. Use `container` for the pseudo-element container or `root` for + the first rendered host element. +- Removed legacy `UNSAFE_*` queries: + - `UNSAFE_getAllByType` + - `UNSAFE_getByType` + - `UNSAFE_getAllByProps` + - `UNSAFE_getByProps` +- Removed the `concurrentRoot` render and configuration option. Concurrent rendering is + always enabled in v14. +- Removed the `createNodeMock` render option, which is not supported by the new Test Renderer + integration. +- Removed the `unstable_validateStringsRenderedWithinText` render option. Text string + validation is now always enabled. + +### Notable changes + +- Reintroduced the `container` API as a safe pseudo-element container, aligned with React + Testing Library semantics. +- Query results and the rendered element tree now expose host elements only. Composite + components are no longer visible through the test tree. +- Type definitions now use `TestInstance` from Test Renderer instead of + `ReactTestInstance` from React Test Renderer. +- Suspended or hidden instances are now represented with React Native-like hidden props, such + as `display: 'none'`, so visibility queries and matchers behave closer to runtime behavior. +- `fireEvent.press()` and `fireEvent.scroll()` now pass default synthetic native event objects + to handlers and deep-merge any event props supplied by the test. +- Accessible name calculation now follows React Native inputs more closely, including + `TextInput` placeholder handling, child accessible name concatenation, and stricter + `getByRole(..., { name })` matching. +- `configure`, `render`, `renderHook`, and `userEvent.setup` now warn when unknown options are + passed, helping catch stale or misspelled options during migration. +- Text strings rendered outside of React Native `` components now throw, matching + React Native runtime behavior. + +### Test Renderer versions + +Install the Test Renderer version that matches your React 19 minor version: + +| React version | Recommended Test Renderer version | +| ------------- | --------------------------------- | +| `19.2` | `test-renderer@1.2` | +| `19.1` | `test-renderer@1.1` | +| `19.0` | `test-renderer@1.0` | + +Older Test Renderer lines may not support newer React 19 features in tests. Newer Test +Renderer lines can produce peer dependency warnings, or an install error with `npm`. See the +[Test Renderer React 19 compatibility lines](https://github.com/mdjastrzebski/test-renderer#react-19-compatibility-lines) +for the latest recommendations. + +### Codemods + +Two codemods are available to automate the most common v14 upgrade work: + +- `rntl-v14-update-deps` updates dependencies by removing React Test Renderer packages, + adding Test Renderer, and updating React Native Testing Library. +- `rntl-v14-async-functions` updates test code for async `render`, `renderHook`, `fireEvent`, + `act`, `rerender`, and `unmount` usage. + +### Full changelog + +See the full GitHub comparison: +https://github.com/callstack/react-native-testing-library/compare/v13.3.3...v14.0.0 diff --git a/codemods/v14-update-deps/README.md b/codemods/v14-update-deps/README.md index 22ee0f7f7..02b5e1893 100644 --- a/codemods/v14-update-deps/README.md +++ b/codemods/v14-update-deps/README.md @@ -6,8 +6,12 @@ This codemod automatically updates your `package.json` to prepare for React Nati - Removes `@types/react-test-renderer` and `react-test-renderer` (no longer needed) - Moves `@testing-library/react-native` to `devDependencies` if it's in `dependencies` -- Updates `@testing-library/react-native` to `^14.0.0-beta.0` -- Adds `test-renderer@^1.0.0` to `devDependencies` +- Updates `@testing-library/react-native` to `^14.0.0-0` +- Adds `test-renderer` to `devDependencies`, using the matching React 19 compatibility line when it can infer one: + - React 19.0: `test-renderer@^1.0.0` + - React 19.1: `test-renderer@^1.1.0` + - React 19.2: `test-renderer@^1.2.0` + - Missing or ambiguous React version: `test-renderer@^1.2.0` ## Usage @@ -37,8 +41,8 @@ npx codemod@latest run rntl-v14-update-deps --target ./path/to/your/project ```json { "devDependencies": { - "@testing-library/react-native": "^14.0.0-beta.0", - "test-renderer": "^1.0.0" + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" } } ``` @@ -50,7 +54,7 @@ npx codemod@latest run rntl-v14-update-deps --target ./path/to/your/project npm install # or yarn install / pnpm install ``` -- The codemod sets the version to `^14.0.0-beta.0`. You can manually update this if needed. +- The codemod sets the version to `^14.0.0-0`. You can manually update this if needed. - For monorepos, the codemod processes each `package.json` file individually. ## Next steps diff --git a/codemods/v14-update-deps/scripts/codemod.ts b/codemods/v14-update-deps/scripts/codemod.ts index 6a441abca..deac4f2ba 100644 --- a/codemods/v14-update-deps/scripts/codemod.ts +++ b/codemods/v14-update-deps/scripts/codemod.ts @@ -3,8 +3,13 @@ import type { Transform } from 'codemod:ast-grep'; import type JSONLang from 'codemod:ast-grep/langs/json'; -const RNTL_VERSION = '^14.0.0-beta.0'; -const TEST_RENDERER_VERSION = '^1.0.0'; +const RNTL_VERSION = '^14.0.0-0'; +const TEST_RENDERER_FALLBACK_VERSION = '^1.2.0'; +const TEST_RENDERER_VERSION_BY_REACT_MINOR: Record = { + '19.0': '^1.0.0', + '19.1': '^1.1.0', + '19.2': '^1.2.0', +}; interface PackageJson { dependencies?: Record; @@ -141,10 +146,44 @@ function ensureRntlInDevDependencies(packageJson: PackageJson): boolean { } function updateTestRendererVersionInDevDependencies(packageJson: PackageJson): boolean { + const expectedVersion = getTestRendererVersion(packageJson); const currentVersion = packageJson.devDependencies?.['test-renderer']; - if (currentVersion !== TEST_RENDERER_VERSION) { - packageJson.devDependencies!['test-renderer'] = TEST_RENDERER_VERSION; + if (currentVersion !== expectedVersion) { + packageJson.devDependencies!['test-renderer'] = expectedVersion; return true; } return false; } + +function getTestRendererVersion(packageJson: PackageJson): string { + const reactVersion = getPackageVersion(packageJson, 'react'); + const reactMinor = reactVersion ? getKnownReact19Minor(reactVersion) : null; + + return reactMinor + ? TEST_RENDERER_VERSION_BY_REACT_MINOR[reactMinor] + : TEST_RENDERER_FALLBACK_VERSION; +} + +function getPackageVersion(packageJson: PackageJson, pkgName: string): string | undefined { + for (const depType of [ + 'dependencies', + 'devDependencies', + 'peerDependencies', + 'optionalDependencies', + ] as const) { + const version = packageJson[depType]?.[pkgName]; + if (version) { + return version; + } + } + + return undefined; +} + +function getKnownReact19Minor(version: string): string | null { + const trimmedVersion = version.trim(); + const exactVersionMatch = trimmedVersion.match(/^=?~?(19\.(?:0|1|2))(?:\.\d+)?(?:-[\w.-]+)?$/); + const xRangeMatch = trimmedVersion.match(/^~?(19\.(?:0|1|2))\.(?:x|\*)$/i); + + return exactVersionMatch?.[1] ?? xRangeMatch?.[1] ?? null; +} diff --git a/codemods/v14-update-deps/tests/fixtures/already-alpha/expected.json b/codemods/v14-update-deps/tests/fixtures/already-alpha/expected.json index 3b0cd4ffa..38249625f 100644 --- a/codemods/v14-update-deps/tests/fixtures/already-alpha/expected.json +++ b/codemods/v14-update-deps/tests/fixtures/already-alpha/expected.json @@ -2,7 +2,7 @@ "name": "test-project", "version": "1.0.0", "devDependencies": { - "@testing-library/react-native": "^14.0.0-beta.0", - "test-renderer": "^1.0.0" + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" } } diff --git a/codemods/v14-update-deps/tests/fixtures/basic-update/expected.json b/codemods/v14-update-deps/tests/fixtures/basic-update/expected.json index 3b0cd4ffa..38249625f 100644 --- a/codemods/v14-update-deps/tests/fixtures/basic-update/expected.json +++ b/codemods/v14-update-deps/tests/fixtures/basic-update/expected.json @@ -2,7 +2,7 @@ "name": "test-project", "version": "1.0.0", "devDependencies": { - "@testing-library/react-native": "^14.0.0-beta.0", - "test-renderer": "^1.0.0" + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" } } diff --git a/codemods/v14-update-deps/tests/fixtures/move-from-deps/expected.json b/codemods/v14-update-deps/tests/fixtures/move-from-deps/expected.json index 3b0cd4ffa..38249625f 100644 --- a/codemods/v14-update-deps/tests/fixtures/move-from-deps/expected.json +++ b/codemods/v14-update-deps/tests/fixtures/move-from-deps/expected.json @@ -2,7 +2,7 @@ "name": "test-project", "version": "1.0.0", "devDependencies": { - "@testing-library/react-native": "^14.0.0-beta.0", - "test-renderer": "^1.0.0" + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" } } diff --git a/codemods/v14-update-deps/tests/fixtures/react-19-0/expected.json b/codemods/v14-update-deps/tests/fixtures/react-19-0/expected.json new file mode 100644 index 000000000..eab52806b --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-19-0/expected.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "react": "19.0.0" + }, + "devDependencies": { + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.0.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-19-0/input.json b/codemods/v14-update-deps/tests/fixtures/react-19-0/input.json new file mode 100644 index 000000000..7c2fc5202 --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-19-0/input.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@testing-library/react-native": "^13.0.0", + "react": "19.0.0" + }, + "devDependencies": { + "react-test-renderer": "19.0.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-19-1/expected.json b/codemods/v14-update-deps/tests/fixtures/react-19-1/expected.json new file mode 100644 index 000000000..1295b3454 --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-19-1/expected.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "react": "~19.1.0" + }, + "devDependencies": { + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.1.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-19-1/input.json b/codemods/v14-update-deps/tests/fixtures/react-19-1/input.json new file mode 100644 index 000000000..a0e18bd89 --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-19-1/input.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@testing-library/react-native": "^13.0.0", + "react": "~19.1.0" + }, + "devDependencies": { + "react-test-renderer": "19.1.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-19-2/expected.json b/codemods/v14-update-deps/tests/fixtures/react-19-2/expected.json new file mode 100644 index 000000000..dd128be82 --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-19-2/expected.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "react": "19.2.x" + }, + "devDependencies": { + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-19-2/input.json b/codemods/v14-update-deps/tests/fixtures/react-19-2/input.json new file mode 100644 index 000000000..4a1ac4b70 --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-19-2/input.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@testing-library/react-native": "^13.0.0", + "react": "19.2.x" + }, + "devDependencies": { + "react-test-renderer": "19.2.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-19-ambiguous-range/expected.json b/codemods/v14-update-deps/tests/fixtures/react-19-ambiguous-range/expected.json new file mode 100644 index 000000000..eee3bdf8c --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-19-ambiguous-range/expected.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "react": "^19.0.0" + }, + "devDependencies": { + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-19-ambiguous-range/input.json b/codemods/v14-update-deps/tests/fixtures/react-19-ambiguous-range/input.json new file mode 100644 index 000000000..9dd4447e8 --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-19-ambiguous-range/input.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@testing-library/react-native": "^13.0.0", + "react": "^19.0.0" + }, + "devDependencies": { + "react-test-renderer": "19.0.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-non-19/expected.json b/codemods/v14-update-deps/tests/fixtures/react-non-19/expected.json new file mode 100644 index 000000000..def355f0a --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-non-19/expected.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "react": "^18.3.0" + }, + "devDependencies": { + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/react-non-19/input.json b/codemods/v14-update-deps/tests/fixtures/react-non-19/input.json new file mode 100644 index 000000000..a296d2100 --- /dev/null +++ b/codemods/v14-update-deps/tests/fixtures/react-non-19/input.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "@testing-library/react-native": "^13.0.0", + "react": "^18.3.0" + }, + "devDependencies": { + "react-test-renderer": "18.3.0" + } +} diff --git a/codemods/v14-update-deps/tests/fixtures/rntl-in-devdeps/expected.json b/codemods/v14-update-deps/tests/fixtures/rntl-in-devdeps/expected.json index cc292c2a9..e9160b88d 100644 --- a/codemods/v14-update-deps/tests/fixtures/rntl-in-devdeps/expected.json +++ b/codemods/v14-update-deps/tests/fixtures/rntl-in-devdeps/expected.json @@ -1,6 +1,6 @@ { "devDependencies": { - "@testing-library/react-native": "^14.0.0-beta.0", - "test-renderer": "^1.0.0" + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" } } diff --git a/codemods/v14-update-deps/tests/fixtures/with-peer-deps/expected.json b/codemods/v14-update-deps/tests/fixtures/with-peer-deps/expected.json index 3b0cd4ffa..38249625f 100644 --- a/codemods/v14-update-deps/tests/fixtures/with-peer-deps/expected.json +++ b/codemods/v14-update-deps/tests/fixtures/with-peer-deps/expected.json @@ -2,7 +2,7 @@ "name": "test-project", "version": "1.0.0", "devDependencies": { - "@testing-library/react-native": "^14.0.0-beta.0", - "test-renderer": "^1.0.0" + "@testing-library/react-native": "^14.0.0-0", + "test-renderer": "^1.2.0" } } diff --git a/website/docs/14.x/docs/start/migration-v14.mdx b/website/docs/14.x/docs/start/migration-v14.mdx index cd97a7047..1c18380e4 100644 --- a/website/docs/14.x/docs/start/migration-v14.mdx +++ b/website/docs/14.x/docs/start/migration-v14.mdx @@ -15,9 +15,10 @@ This guide describes the migration to React Native Testing Library version 14 fr RNTL v14 drops support for React 18 and adopts React 19's async rendering model. Here's what changed: - React 19.0.0+ and React Native 0.78+ are now required +- Node.js `^22.13.0 || >=24` is now required - `render`, `renderHook`, `fireEvent`, and `act` are now async - Switched from deprecated [React Test Renderer](https://reactjs.org/docs/test-renderer.html) to [Test Renderer](https://github.com/mdjastrzebski/test-renderer) -- Removed deprecated APIs: `update`, `getQueriesForElement`, `UNSAFE_root`, `concurrentRoot` option +- Removed deprecated APIs: `update`, `getQueriesForElement`, `UNSAFE_root`, `concurrentRoot` option, `createNodeMock` option - Reintroduced `container` API, which is now safe to use :::info React 18 Users @@ -56,14 +57,14 @@ After running the codemods, review the changes and run your tests. ## Breaking Changes -### Supported React and React Native versions +### Supported React, React Native, and Node.js versions -**This version requires React 19+ and React Native 0.78+.** If you need to support React 18, please use the latest v13.x version. +**This version requires React 19+, React Native 0.78+, and Node.js `^22.13.0 || >=24`.** If you need to support React 18, please use the latest v13.x version. -| RNTL Version | React Version | React Native Version | -| ------------ | ------------- | -------------------- | -| v14.x | >= 19.0.0 | >= 0.78 | -| v13.x | >= 18.0.0 | >= 0.71 | +| RNTL Version | React Version | React Native Version | Node.js Version | +| ------------ | ------------- | -------------------- | ------------------ | +| v14.x | >= 19.0.0 | >= 0.78 | ^22.13.0 \|\| >=24 | +| v13.x | >= 18.0.0 | >= 0.71 | >= 18 | ### Test Renderer replaces React Test Renderer @@ -74,6 +75,21 @@ In v14, React Native Testing Library uses [Test Renderer](https://github.com/mdj - The underlying renderer is now Test Renderer instead of React Test Renderer - This is mostly an internal change; your tests should work without modifications in most cases - Type definitions now use [`TestInstance`](https://github.com/mdjastrzebski/test-renderer#test-instance) from Test Renderer instead of `ReactTestInstance` +- Test Renderer 1.x is required as a peer dependency. Use the recommended Test Renderer version for your React 19 minor version. + +#### Recommended Test Renderer versions + +Choose the Test Renderer version that matches your React 19 minor version: + +| React version | Recommended Test Renderer version | Notable React features | +| ------------- | --------------------------------- | ------------------------------------------------- | +| `19.2` | `test-renderer@1.2` | ``, `useEffectEvent` | +| `19.1` | `test-renderer@1.1` | Owner Stack support, updated `useId()` format | +| `19.0` | `test-renderer@1.0` | Actions, `useActionState`, `useOptimistic`, `use` | + +Using an older Test Renderer line can prevent RNTL from supporting newer React 19 features in your tests. Using a newer Test Renderer line than your React version can produce peer dependency warnings, or an install error with `npm`. + +See the [Test Renderer React 19 compatibility lines](https://github.com/mdjastrzebski/test-renderer#react-19-compatibility-lines) for the latest recommendations. **Migration:** @@ -92,17 +108,19 @@ Run codemod for updating dependencies: ##### Manual changes -Remove React Test Renderer and its type definitions from your dev dependencies, and add Test Renderer: +Remove React Test Renderer and its type definitions from your dev dependencies, and add the Test Renderer line that matches your React minor version: +The commands above use `test-renderer@1.2` for React 19.2. Use `test-renderer@1.1` for React 19.1, or `test-renderer@1.0` for React 19.0. + #### 2. Update type imports (if needed) If you were directly importing types from React Test Renderer, you may need to update your imports: @@ -223,6 +241,22 @@ it('should press button', async () => { }); ``` +`fireEvent.press()` and `fireEvent.scroll()` now create default synthetic native event objects. If you pass event props, they are deep-merged into the default event object: + +```ts +await fireEvent.press(screen.getByText('Press me'), { + nativeEvent: { pageX: 20, pageY: 30 }, +}); + +expect(onPress).toHaveBeenCalledWith( + expect.objectContaining({ + nativeEvent: expect.objectContaining({ pageX: 20, pageY: 30 }), + }) +); +``` + +If your v13 assertions expected the handler to receive exactly the object you passed to `fireEvent.press()` or `fireEvent.scroll()`, update them to use partial matching. + #### `act` is now async In v14, `act` is async by default and always returns a Promise. You should always `await` the result of `act()`. @@ -353,6 +387,27 @@ await render(); // Always uses concurrent rendering **Migration:** Remove any `concurrentRoot` options from your `render` calls and `configure` function. If you were setting `concurrentRoot: true`, just remove the option. If you were setting `concurrentRoot: false` to disable concurrent rendering, this is no longer supported in v14. +#### `createNodeMock` option removed + +The `createNodeMock` render option has been removed. It was previously passed through to React Test Renderer, but the v14 Test Renderer integration does not support this option. + +```ts +// Before (v13) +render(, { + createNodeMock: (element) => { + if (element.type === TextInput) { + return { focus: jest.fn() }; + } + return {}; + }, +}); + +// After (v14) +await render(); +``` + +If you used `createNodeMock` to mock imperative refs, prefer testing user-visible behavior and mock the component or native module at the boundary where the ref behavior is introduced. + ### `container` API reintroduced In v14, the `container` API has been reintroduced and is now safe to use. Previously, `container` was renamed to `UNSAFE_root` in v12 due to behavioral differences from React Testing Library's `container`. Now `container` returns a pseudo-element container whose children are the elements you rendered, consistent with React Testing Library's behavior. @@ -419,6 +474,35 @@ await render(); If you were relying on the previous behavior where strings could be rendered outside of `` components, you'll need to fix your components to wrap strings in `` components, as this matches React Native's actual runtime behavior. +### Hidden Suspense and Activity content + +When React keeps previously rendered content hidden, such as suspended content or React 19.2 ``, RNTL now applies React Native-like hidden props to the affected instances. In practice, hidden instances receive `display: 'none'`, preserving existing styles by appending the hidden style. + +This makes visibility queries and matchers behave closer to runtime behavior: + +- default queries do not match hidden instances +- queries with `{ includeHiddenElements: true }` can still find hidden instances +- `toBeVisible()` treats these instances as hidden + +### Accessible name changes + +Accessible name calculation has been updated to better match React Native behavior: + +- `aria-labelledby` and `accessibilityLabelledBy` still take precedence over explicit labels +- `aria-label` and `accessibilityLabel` take precedence over text content +- `Image` `alt` is used as an accessible label +- a root `TextInput` can use its `placeholder` as its accessible name +- child accessible names are concatenated with spaces +- child `TextInput` placeholders are not used when computing a parent's accessible name + +This affects `getByRole(..., { name })` and `toHaveAccessibleName()`. If a v13 role query matched because descendant text or label queries were used as a fallback, update the test to match the element's computed accessible name directly or query the descendant element instead. + +### Unknown options now warn + +RNTL now logs a warning when unknown options are passed to `configure`, `render`, `renderHook`, or `userEvent.setup`. This helps catch stale v13 options and misspellings during migration. + +For example, after removing `concurrentRoot`, `createNodeMock`, or `unstable_validateStringsRenderedWithinText`, make sure those options are not still being passed through shared test helpers. + ## Codemods Two codemods are available to automate the migration. Both are safe to run multiple times - they only transform code that hasn't been migrated yet. @@ -428,8 +512,8 @@ Two codemods are available to automate the migration. Both are safe to run multi Updates your `package.json`: - Removes React Test Renderer (`react-test-renderer` and `@types/react-test-renderer`) -- Adds Test Renderer (`test-renderer`) -- Updates `@testing-library/react-native` to alpha version +- Adds Test Renderer (`test-renderer`) using the current recommended 1.x line +- Updates `@testing-library/react-native` to the v14 version