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
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/advanced/testing-env.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,11 +18,11 @@ React allows you to write declarative code using JSX, write function or class co
18
18
19
19
When you run your tests in the React Native Testing Library, somewhat contrary to what the name suggests, they are actually **not** using React Native renderer. This is because this renderer needs to be run on an iOS or Android operating system, so it would need to run on a device or simulator.
20
20
21
-
## Universal Test Renderer
21
+
## Test Renderer
22
22
23
-
Instead, RNTL uses [Universal Test Renderer](https://github.com/mdjastrzebski/test-renderer), a modern, actively maintained renderer that allows rendering to pure JavaScript objects without access to mobile OS and can run in a Node.js environment using Jest (or any other JavaScript test runner). Universal Test Renderer replaces the deprecated `react-test-renderer` package and provides better compatibility with React 19 and improved type safety.
23
+
Instead, RNTL uses [Test Renderer](https://github.com/mdjastrzebski/test-renderer), a modern, actively maintained renderer that allows rendering to pure JavaScript objects without access to mobile OS and can run in a Node.js environment using Jest (or any other JavaScript test runner). Test Renderer replaces the deprecated `react-test-renderer` package and provides better compatibility with React 19 and improved type safety.
24
24
25
-
Using Universal Test Renderer has pros and cons.
25
+
Using Test Renderer has pros and cons.
26
26
27
27
Benefits:
28
28
@@ -41,9 +41,9 @@ It's worth noting that the React Testing Library (web one) works a bit different
41
41
42
42
## Element tree
43
43
44
-
Calling the `render()` function creates an element tree. This is done internally by invoking the renderer's `create()` method from Universal Test Renderer. The output tree represents your React Native component tree, and each node of that tree is an "instance" of some React component (to be more precise, each node represents a React fiber, and only class components have instances, while function components store the hook state using fibers).
44
+
Calling the `render()` function creates an element tree. This is done internally by invoking the renderer's `create()` method from Test Renderer. The output tree represents your React Native component tree, and each node of that tree is an "instance" of some React component (to be more precise, each node represents a React fiber, and only class components have instances, while function components store the hook state using fibers).
45
45
46
-
These tree elements are represented by `HostElement` type from Universal Test Renderer:
46
+
These tree elements are represented by `HostElement` type from Test Renderer:
47
47
48
48
```tsx
49
49
interfaceHostElement {
@@ -56,7 +56,7 @@ interface HostElement {
56
56
}
57
57
```
58
58
59
-
For more details, see the [Universal Test Renderer documentation](https://github.com/mdjastrzebski/test-renderer).
59
+
For more details, see the [Test Renderer documentation](https://github.com/mdjastrzebski/test-renderer).
This option allows you to pass `createNodeMock` option to the renderer's `create()` method in order to allow for custom mock refs. This option is passed through to [Universal Test Renderer](https://github.com/mdjastrzebski/test-renderer).
48
+
This option allows you to pass `createNodeMock` option to the renderer's `create()` method in order to allow for custom mock refs. This option is passed through to [Test Renderer](https://github.com/mdjastrzebski/test-renderer).
49
49
50
50
:::note Text string validation
51
51
52
-
Universal Test Renderer automatically enforces React Native's requirement that text strings must be rendered within a `<Text>` component. If you try to render a `string` value under components other than `<Text>` (e.g., under `<View>`), it will throw an `Invariant Violation: Text strings must be rendered within a <Text> component` error, matching React Native's runtime behavior.
52
+
Test Renderer automatically enforces React Native's requirement that text strings must be rendered within a `<Text>` component. If you try to render a `string` value under components other than `<Text>` (e.g., under `<View>`), it will throw an `Invariant Violation: Text strings must be rendered within a <Text> component` error, matching React Native's runtime behavior.
53
53
54
54
This validation is always enabled and cannot be disabled, ensuring your tests accurately reflect how your code will behave in production.
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/api/screen.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ Get the rendered component JSON representation, e.g. for snapshot testing.
148
148
const container:HostElement;
149
149
```
150
150
151
-
Returns a pseudo-element container whose children are the elements you asked to render. This is the root container element from [Universal Test Renderer](https://github.com/mdjastrzebski/test-renderer).
151
+
Returns a pseudo-element container whose children are the elements you asked to render. This is the root container element from [Test Renderer](https://github.com/mdjastrzebski/test-renderer).
152
152
153
153
The `container` is safe to use and provides access to the entire rendered tree. It's useful when you need to query or manipulate the entire rendered output, similar to how `container` works in [React Testing Library](https://testing-library.com/docs/react-testing-library/other#container-1).
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/guides/faq.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ React Native Testing Library does not provide an entire React Native runtime sin
8
8
or iOS simulator/Android emulator to provision the underlying OS and platform APIs.
9
9
10
10
Instead of using React Native renderer, it simulates only the JavaScript part of its runtime
11
-
using [Universal Test Renderer](https://github.com/mdjastrzebski/test-renderer) while providing queries
11
+
using [Test Renderer](https://github.com/mdjastrzebski/test-renderer) while providing queries
12
12
and event APIs ([User Event](docs/api/events/user-event), [Fire Event](docs/api/events/fire-event)) that mimicking certain behaviors from the actual runtime.
13
13
14
14
You can learn more about our testing environment [here](docs/advanced/testing-env).
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/guides/troubleshooting.mdx
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,17 +2,17 @@
2
2
3
3
This guide describes common issues found by users when integrating React Native Test Library to their projects:
4
4
5
-
## Matching React Native, React & Universal Test Renderer versions
5
+
## Matching React Native, React & Test Renderer versions
6
6
7
7
Check that you have matching versions of core dependencies:
8
8
9
9
- React Native
10
10
- React
11
-
-Universal Test Renderer (automatically installed with RNTL)
11
+
- Test Renderer (automatically installed with RNTL)
12
12
13
13
React Native uses different versioning scheme from React, you can use [React Native Upgrade Helper](https://react-native-community.github.io/upgrade-helper/) to find the correct matching between React Native & React versions. In case you use Expo, run `npx expo install --fix` in your project to validate and install compatible versions of these dependencies.
14
14
15
-
Universal Test Renderer is automatically managed as a dependency of React Native Testing Library and is compatible with React 18 and React 19.
15
+
Test Renderer is automatically managed as a dependency of React Native Testing Library and is compatible with React 18 and React 19.
16
16
17
17
Related issues: [#1061](https://github.com/callstack/react-native-testing-library/issues/1061), [#938](https://github.com/callstack/react-native-testing-library/issues/938), [#920](https://github.com/callstack/react-native-testing-library/issues/920)
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/migration/v14.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,15 +4,15 @@ This guide describes the migration to React Native Testing Library version 14 fr
4
4
5
5
## Breaking changes
6
6
7
-
### Universal Test Renderer replaces React Test Renderer
7
+
### Test Renderer replaces React Test Renderer
8
8
9
-
In v14, React Native Testing Library now uses [Universal Test Renderer](https://github.com/mdjastrzebski/test-renderer) instead of the deprecated `react-test-renderer` package. Universal Test Renderer is a modern, actively maintained alternative that provides better compatibility with React 19 and improved type safety.
9
+
In v14, React Native Testing Library now uses [Test Renderer](https://github.com/mdjastrzebski/test-renderer) instead of the deprecated `react-test-renderer` package. Test Renderer is a modern, actively maintained alternative that provides better compatibility with React 19 and improved type safety.
10
10
11
11
**What changed:**
12
12
13
13
- The underlying rendering engine has been switched from `react-test-renderer` to `test-renderer`
14
14
- This change is mostly internal and should not require code changes in most cases
15
-
- Type definitions have been updated to use `HostElement` from Universal Test Renderer instead of `ReactTestInstance`
15
+
- Type definitions have been updated to use `HostElement` from Test Renderer instead of `ReactTestInstance`
16
16
17
17
**Migration:**
18
18
@@ -48,7 +48,7 @@ import type { HostElement } from 'test-renderer';
48
48
49
49
**Note:** Most users won't need to update type imports, as React Native Testing Library now exports the necessary types directly.
50
50
51
-
For more details, see the [Universal Test Renderer documentation](https://github.com/mdjastrzebski/test-renderer).
51
+
For more details, see the [Test Renderer documentation](https://github.com/mdjastrzebski/test-renderer).
52
52
53
53
### `container` API reintroduced
54
54
@@ -57,7 +57,7 @@ In v14, the `container` API has been reintroduced and is now safe to use. Previo
57
57
**What changed:**
58
58
59
59
-`screen.container` is now available and safe to use
60
-
-`container` returns a pseudo-element container from Universal Test Renderer
60
+
-`container` returns a pseudo-element container from Test Renderer
61
61
- The container's children are the elements you rendered
### Text string validation now enforced by default
501
501
502
-
In v14, Universal Test Renderer automatically enforces React Native's requirement that text strings must be rendered within a `<Text>` component. This means the `unstable_validateStringsRenderedWithinText` option has been removed from `RenderOptions`, as this validation is now always enabled.
502
+
In v14, Test Renderer automatically enforces React Native's requirement that text strings must be rendered within a `<Text>` component. This means the `unstable_validateStringsRenderedWithinText` option has been removed from `RenderOptions`, as this validation is now always enabled.
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/start/intro.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ You want to write maintainable tests for your React Native components. As a part
6
6
7
7
## This solution
8
8
9
-
The React Native Testing Library (RNTL) is a lightweight solution for testing React Native components. It provides light utility functions on top of [Universal Test Renderer](https://github.com/mdjastrzebski/test-renderer), in a way that encourages better testing practices. Its primary guiding principle is:
9
+
The React Native Testing Library (RNTL) is a lightweight solution for testing React Native components. It provides light utility functions on top of [Test Renderer](https://github.com/mdjastrzebski/test-renderer), in a way that encourages better testing practices. Its primary guiding principle is:
10
10
11
11
> The more your tests resemble how your software is used, the more confidence they can give you.
Copy file name to clipboardExpand all lines: website/docs/14.x/docs/start/quick-start.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Open a Terminal in your project's folder and run:
13
13
}}
14
14
/>
15
15
16
-
This library uses [Universal Test Renderer](https://github.com/mdjastrzebski/test-renderer) as its underlying rendering engine. Universal Test Renderer is automatically installed as a dependency and provides better compatibility with React 19 and improved type safety compared to the deprecated `react-test-renderer` package.
16
+
This library uses [Test Renderer](https://github.com/mdjastrzebski/test-renderer) as its underlying rendering engine. Test Renderer is automatically installed as a dependency and provides better compatibility with React 19 and improved type safety compared to the deprecated `react-test-renderer` package.
0 commit comments