# callstack/react-native-testing-library

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/callstack-react-native-testing-library).**

3,390 stars · 281 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/callstack/react-native-testing-library
- Homepage: https://oss.callstack.com/react-native-testing-library/
- awesome-repositories: https://awesome-repositories.com/repository/callstack-react-native-testing-library.md

## Topics

`jest` `react` `react-native` `testing`

## Description

This project is a testing framework designed for React Native applications, providing a suite of tools to render components in a controlled memory environment. It enables developers to verify the behavior and structure of mobile interfaces by simulating user interactions and monitoring component lifecycle transitions. By isolating components from the rest of the application, it ensures that tests remain stable and independent.

The framework distinguishes itself through an accessibility-first approach, prioritizing user-facing attributes like roles, labels, and text content when querying the component tree. This methodology ensures that tests reflect how a real user perceives and interacts with the interface, rather than relying on internal implementation details. It also includes robust support for asynchronous operations, automatically synchronizing assertions with background state updates and delayed UI rendering to prevent race conditions.

Beyond core rendering and interaction, the library provides comprehensive capabilities for validating UI state, inspecting component styles, and verifying accessibility properties. It supports testing custom hooks in isolation, managing complex component trees through provider injection, and performing structural verification via snapshots. These features allow for thorough quality assurance across various mobile interface scenarios.

## Tags

### Testing & Quality Assurance

- [Component and Interaction Testing](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/browser-ui-interaction/component-interaction-testing.md) — Mounts components into a virtual environment to enable interaction and verification during testing. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/render))
- [React Native Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/unit/react-testing-utilities/react-native-testing-frameworks.md) — Provides a specialized framework for testing mobile components by simulating user interactions and verifying rendered output through accessible, user-centric queries.
- [Asynchronous UI Test Verifications](https://awesome-repositories.com/f/testing-quality-assurance/asynchronous-ui-test-verifications.md) — Synchronizes test assertions with background state updates to verify application behavior in asynchronous scenarios.
- [User Interaction Simulation](https://awesome-repositories.com/f/testing-quality-assurance/automation-interaction-tools/user-interaction-simulation.md) — Simulates user inputs like presses and gestures to verify application responsiveness to real-world behavior. ([source](https://github.com/callstack/react-native-testing-library#readme))
- [Component Content Validation](https://awesome-repositories.com/f/testing-quality-assurance/component-content-validation.md) — Check that interface elements display the correct text or accessible names to ensure that the information presented to the user matches the intended design. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/jest-matchers))
- [Component Rendering Utilities](https://awesome-repositories.com/f/testing-quality-assurance/component-rendering-utilities.md) — Provides utilities for mounting and rendering components in a controlled environment to facilitate testing. ([source](https://github.com/callstack/react-native-testing-library#readme))
- [Auto-Waiting Assertions](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/assertion-extensions-modes/asynchronous-interaction-utilities/auto-waiting-assertions.md) — Pauses test execution while repeatedly checking conditions to ensure assertions account for delayed state changes. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/misc/async))
- [Element State Assertions](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/assertion-extensions-modes/asynchronous-interaction-utilities/element-state-assertions.md) — Provides specialized matchers to verify element properties and accessibility status during UI state validation. ([source](https://github.com/callstack/react-native-testing-library#readme))
- [Asynchronous Test Handling](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/test-lifecycle-execution-control/test-execution-controls/asynchronous-test-handling.md) — Synchronizes test assertions with asynchronous UI updates and state transitions. ([source](https://github.com/callstack/react-native-testing-library#readme))
- [React Component Testing](https://awesome-repositories.com/f/testing-quality-assurance/react-component-testing.md) — Implements a testing environment for mounting and verifying React-based mobile UI components in isolation.
- [Visual Assertion Validators](https://awesome-repositories.com/f/testing-quality-assurance/validation-verification/input-validation/agent-input-and-output-validators/automated-assertion-validators/visual-assertion-validators.md) — Asserts expectations about rendered output, including visibility and accessibility status, using specialized matchers. ([source](https://github.com/callstack/react-native-testing-library/blob/main/README-v13.md))
- [Component Re-renderers](https://awesome-repositories.com/f/testing-quality-assurance/component-rendering-utilities/component-re-renderers.md) — Supports re-rendering components with new properties to process asynchronous updates during testing. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/screen))
- [Snapshot Verification Tools](https://awesome-repositories.com/f/testing-quality-assurance/dom-structure-verification/snapshot-verification-tools.md) — Serializes rendered component trees into persistent snapshots to track and validate UI structure over time.
- [Test Isolation](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-isolation.md) — Ensures test stability by mounting components into isolated, controlled memory environments.
- [Asynchronous Polling Mechanisms](https://awesome-repositories.com/f/testing-quality-assurance/general-testing-utilities/test-utilities-assertions/assertion-extensions-modes/asynchronous-interaction-utilities/asynchronous-polling-mechanisms.md) — Implements asynchronous polling mechanisms to synchronize test assertions with background UI updates.
- [Mobile Accessibility Auditing](https://awesome-repositories.com/f/testing-quality-assurance/mobile-accessibility-auditing.md) — Provides utilities for verifying that mobile interface elements correctly communicate their status and labels to assistive technologies.
- [Accessibility Testing Tools](https://awesome-repositories.com/f/testing-quality-assurance/mobile-accessibility-auditing/accessibility-testing-tools.md) — Provides a testing environment that prioritizes user-facing roles and labels to ensure mobile interfaces are perceivable by assistive technologies.
- [Component Testing](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/component-testing.md) — Provides a library for verifying the behavior and structure of UI components through isolated testing and lifecycle management.
- [Text Rendering Stress Tests](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/gui/text-rendering-stress-tests.md) — Enforces runtime constraints by validating that text strings are correctly placed within designated containers. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/render))
- [Mobile Testing Frameworks](https://awesome-repositories.com/f/testing-quality-assurance/software-testing/testing-frameworks/test-frameworks/test-levels-and-types/mobile-testing-frameworks.md) — Offers a comprehensive testing environment for mobile applications that supports component rendering, state validation, and asynchronous event simulation.

### Graphics & Multimedia

- [Scene Element Queries by Criteria](https://awesome-repositories.com/f/graphics-multimedia/graphics-engines-rendering/scene-management-systems/object-hierarchy-management/scene-graph-hierarchy-querying/scene-element-queries-by-criteria.md) — Enables retrieval of specific interface components using criteria like roles, labels, or text. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/queries))

### User Interface & Experience

- [Accessibility Query Engines](https://awesome-repositories.com/f/user-interface-experience/accessibility-role-mapping/accessibility-query-engines.md) — Provides an accessibility-first query engine to locate interface elements by roles and labels.
- [Component Lifecycle Hooks](https://awesome-repositories.com/f/user-interface-experience/component-lifecycle-hooks.md) — Wraps components in lifecycle hooks to monitor state transitions and side effects during testing.
- [Accessibility State Synchronization](https://awesome-repositories.com/f/user-interface-experience/custom-header-components/section-headers/section-transition-monitors/navigation-state-synchronizers/accessibility-state-synchronization.md) — Validates that interface elements correctly communicate their accessibility states to assistive technologies. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/jest-matchers))
- [Custom Hook Testing](https://awesome-repositories.com/f/user-interface-experience/presentation-frameworks/lifecycle-state-management/component-lifecycle-management/component-logic-patterns/custom-hooks/custom-hook-testing.md) — Enables testing of hook logic in isolation to verify state transitions and side effects without a full component tree. ([source](https://github.com/callstack/react-native-testing-library#readme))
- [User-Centric Verification](https://awesome-repositories.com/f/user-interface-experience/themed-user-interfaces/user-centric-verification.md) — Enables testing mobile applications by querying elements based on how a real user perceives the interface.

### Web Development

- [Asynchronous Element Waiting](https://awesome-repositories.com/f/web-development/browser-integration-utilities/dom-event-handling/dynamic-element-event-handling/asynchronous-element-waiting.md) — Queries the component tree repeatedly until elements appear, synchronizing tests with asynchronous UI updates. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/misc/async))
- [Test-Controlled State Updates](https://awesome-repositories.com/f/web-development/state-update-handlers/debounced-state-updates/immediate-state-updates/synchronous-state-updates/test-controlled-state-updates.md) — Forces state updates and asynchronous effects to complete before assertions run to prevent race conditions. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/misc/other))
- [Context Providers](https://awesome-repositories.com/f/web-development/context-providers.md) — Injects context providers and layout wrappers to simulate the application environment required for state management. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/render))
- [Element Wait Conditions](https://awesome-repositories.com/f/web-development/dom-element-selectors/element-wait-conditions.md) — Monitors the component tree until elements are removed, confirming successful unmounting or hiding of UI components. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/misc/async))
- [Scoped Queries](https://awesome-repositories.com/f/web-development/dom-element-selectors/scoped-queries.md) — Allows restricting search queries to specific subtrees to isolate interactions within complex component structures. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/misc/other))
- [Presence Verifiers](https://awesome-repositories.com/f/web-development/element-selectors/presence-verifiers.md) — Validates the presence and existence of components within the rendered structure during tests. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/jest-matchers))

### Education & Learning Resources

- [Rendered Tree Querying](https://awesome-repositories.com/f/education-learning-resources/technical-domain-education/technical-academic-domains/algorithmic-design-analysis/tree-data-structures/tree-traversal-utilities/rendered-tree-querying.md) — Locates specific components in the rendered tree using attributes for state verification. ([source](https://github.com/callstack/react-native-testing-library#readme))

### Software Engineering & Architecture

- [Component Snapshots](https://awesome-repositories.com/f/software-engineering-architecture/architectural-design-patterns/state-management/persistence-and-serialization/state-serialization/state-snapshots/component-snapshots.md) — Generates JSON snapshots of component trees to facilitate structural verification. ([source](https://oss.callstack.com/react-native-testing-library/docs/api/screen))
- [User Action Intents](https://awesome-repositories.com/f/software-engineering-architecture/intent-based-coordination/intent-to-action-handlers/user-action-intents.md) — Locates components using user-centric intent criteria like roles and labels. ([source](https://oss.callstack.com/react-native-testing-library/))
- [Component Tree Traversers](https://awesome-repositories.com/f/software-engineering-architecture/tree-traversal-algorithms/document-tree-traversers/dom-hierarchy-navigators/component-tree-traversers.md) — Navigates rendered component hierarchies to locate elements based on accessibility and structural properties.
