Skip to content
CAI
Software that uses CAICheck a score

testing-library/react-testing-library

61.9

Adequate · 1 October 2026

860

lines of production code

JavaScript

with TypeScript

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is the React Testing Library, a testing utility designed to render and interact with React components. It provides core APIs for rendering components, firing DOM events, and testing hooks, while ensuring tests run in a user-centric manner. The library manages test lifecycle concerns such as automatic cleanup, strict mode enforcement, and compatibility with modern React versions.

Features

Ship internal TypeScript definitions and type tests

The library now includes its own TypeScript declaration files (types/index.d.ts, types/pure.d.ts) and a comprehensive type test suite (types/test.tsx) directly in the repository, replacing the previous reliance on DefinitelyTyped. These definitions expose the public API including render, renderHook, configure, and getConfig, and are configured with exactOptionalPropertyTypes enabled to ensure stricter type checking for optional properties.

types · high confidence

Behavioural changes

Major rewrite for React 18 support with automatic cleanup and strict mode

The library has been rewritten to support React 18's concurrent features, introducing a new \act\ compatibility layer that bridges native React 18 \act\ with older versions. The \render\ function now supports a \reactStrictMode\ option to wrap components in React's StrictMode, and automatically handles cleanup after tests if \afterEach\ or \teardown\ hooks are detected (unless disabled via \RTL\_SKIP\_AUTO\_CLEANUP\). Event firing logic has been updated to correctly dispatch React-specific events like \mouseEnter/Leave\ and \focus/blur\. The legacy \Simulate\ API and \flushPromises\ have been removed in favor of the new \fireEvent\ implementation and automatic act wrapping.

src · high confidence

Mock implementation for axios updated with usage notes

The mock for the axios library in the test environment now includes a comment explaining that only the GET method is currently implemented and that additional methods (POST, PUT, PATCH) will be added only if needed, referencing a related issue in the react-testing-library repository.

src/\\mocks\\_ · high confidence_

Project maintenance documentation updates

The project has moved the Code of Conduct file to the root directory and updated the MAINTAINING guide to reflect the switch from Travis CI to GitHub Actions, including the new branch name 'main'. Additionally, a README for design files was added to document the cheat sheet's source assets, and the manual release log was incremented to five.

other · high confidence

Repository migration to testing-library organization and modernization of build tooling

The project has moved from the \kentcdodds\ owner to the \testing-library\ organization, updating all repository references, contributor configurations, and documentation links accordingly. The build infrastructure has been modernized by replacing Travis CI with GitHub Actions and switching to \kcd-scripts\ for standardized configuration of Jest, Prettier, and Husky. Additionally, the repository's default branch has been renamed from \master\ to \main\, and the project now enforces HTTPS for the npm registry and standardizes line endings across text files.

(repo-wide) · high confidence

Test coverage

Added comprehensive test suite for React Testing Library core APIs; Added test infrastructure for console warning/error validation.

Dependencies

Upgrade to React 19 and modernize dependencies

The package now requires Node.js 18 or higher and upgrades its peer dependencies to support React 18 and 19, along with their corresponding type definitions. Development dependencies have been updated to include @testing-library/dom 10, Jest 29, and TypeScript 5, while the build process now utilizes npm-run-all2 for parallel tasks. The package name has been updated to @testing-library/react, and the repository URL has been moved to the testing-library organization.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 59 → 62 (+3.0)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 62 → 62 (+0.0)
  • Architecture 69 → 69 (+0.0)
  • Maturity 57 → 57 (+0.0)
  • Readiness 63 → 64 (+1.0)
  • Security 57 → 70 (+12.9)
  • Performance 100 (new)

Resolved (3)

  • Documentation: no contributor guidance (README.md)
  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)

New (1)

  • Scanner failed to run — not a clean result

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

testing-library/react-testing-library was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 20ce75f2907ca0e5c5a8ae595c0e9a4e368c7800 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.