CodeVetter · Repo Unpack · Extension points
testing-library/react-testing-library
Consumer extension primarily happens through render options and configuration rather than a plugin registry. The root adapters and event forwarding also provide internal seams for compatibility work. Public additions need coordinated runtime exports, declarations, and behavioral tests.
- RenderOptions.queries accepts a custom query set, and renderRoot binds it through getQueriesForElement; custom sets replace defaults unless the caller merges them.
- RenderResult maps each supplied query key to BoundFunction, preserving custom-query typing through the generic render overload.
- wrapper is the documented seam for reusable render helpers that install providers; renderHook passes it through the same render pipeline.
- configure accepts object or functional deltas and forwards DOM options, supporting changes such as testIdAttribute alongside RTL strict mode.
- createConcurrentRoot and createLegacyRoot are internal factories with the same lifecycle methods; render chooses between them via legacyRoot.
- fireEvent copies every enumerable DOM helper at module load, then overrides selected helpers; new React event adaptations belong beside those explicit sequences.
- onCaughtError and onRecoverableError are root-creation callback seams, with onCaughtError typed conditionally against installed ReactDOM RootOptions; onUncaughtError is deliberately excluded.
- The pure import lets alternative runners own cleanup scheduling while retaining the public API; its declaration forwarding chain ends at the same types/index.d.ts surface.