CodeVetter · Repo Unpack · System map
testing-library/react-testing-library
The runtime is a library loaded into a consumer's test process and DOM environment. React owns rendering, DOM Testing Library owns query machinery, and this repository supplies lifecycle and scheduling adapters. Distribution and release are described by package scripts and GitHub workflows.
- The package advertises dist/index.js as main, an ESM bundle as module, types/index.d.ts as declarations, and Node >=18.
- src/index.js adds runner lifecycle hooks and then re-exports src/pure.js; the published pure.js shim instead requires dist/pure.
- src/pure.js is the orchestration module: it imports React, both ReactDOM APIs, DOM query utilities, act compatibility, event adaptation, and configuration.
- Root adapters provide a common hydrate/render/unmount interface over ReactDOMClient and legacy ReactDOM methods.
- Lifecycle storage consists of module-local mountedContainers and mountedRootEntries; cleanup clears both after unmounting.
- React and ReactDOM 18 or 19 and DOM Testing Library 10 are peer integrations; @babel/runtime is the declared production dependency.
- Build runs three parallel kcd-scripts targets; test, lint, validate, and typecheck are package scripts, with typecheck invoking tsc against the root config.
- Release builds npm artifacts after validation and invokes semantic-release 25 only for pushes in the upstream repository; the package includes dist, shims, and declaration files.