๐ฆ Simple and complete React Native testing utilities that encourage good testing practices.
Repo callstack/react-native-testing-library, read from GitHub 1 h ago. callstack has not joined Take My Repo.
fireEvent.layout (#1931) (c1978b3)accessibilityAction (#1930) (34c731d)pullToRefresh() (#1822) (219adbd)fireEvent.layout direct event (#1937) (2155247)fireEvent (#1941) (7e25db3)selection in TextInput change event (#1919) (e819f77)Full Changelog: v14.0.0...v14.0.1
See the Migration to 14.x guide for step-by-step upgrade instructions, codemods, and before/after examples.
^22.13.0 || >=24.render() now returns Promise<RenderResult>.renderHook() now returns Promise<RenderHookResult>.fireEvent() and its helpers now return Promise<void>.act() now always returns a Promise and should always be awaited.renderAsync, renderHookAsync, and fireEventAsync APIs. Use render,renderHook, and fireEvent instead.update alias. Use rerender instead.getQueriesForElement alias. Use within instead.UNSAFE_root. Use container for the pseudo-element container or root forUNSAFE_* queries:
UNSAFE_getAllByTypeUNSAFE_getByTypeUNSAFE_getAllByPropsUNSAFE_getByPropsconcurrentRoot render and configuration option. Concurrent rendering iscreateNodeMock render option, which is not supported by the new Test Rendererunstable_validateStringsRenderedWithinText render option. Text stringcontainer API as a safe pseudo-element container, aligned with ReactTestInstance from Test Renderer instead ofReactTestInstance from React Test Renderer.display: 'none', so visibility queries and matchers behave closer to runtime behavior.fireEvent.press() and fireEvent.scroll() now pass default synthetic native event objectsTextInput placeholder handling, child accessible name concatenation, and strictergetByRole(..., { name }) matching.configure, render, renderHook, and userEvent.setup now warn when unknown options are<Text> components now throw, matchingInstall 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 for the latest recommendations.
Two codemods are available to automate the most common v14 upgrade work:
rntl-v14-update-deps updates dependencies by removing React Test Renderer packages,rntl-v14-async-functions updates test code for async render, renderHook, fireEvent,act, rerender, and unmount usage.See the full GitHub comparison:
v13.3.3...v14.0.0
dist instead of builddocsaccessiblityLabelledBy prop (#1909) (1e0a97b)