# System map — testing-library/dom-testing-library

> Canonical page: https://codevetter.com/unpack/dom-testing-library/system-map

# System map — testing-library/dom-testing-library

Scanned commit 6049cc0bc7cf2201625c476c95fa6299d0e2fa8b (2026-09-13). Generated by codevetter codevetter 1.15.0 on 2026-10-02.

Source inspection; upstream code and tests were not executed.

The runtime is an importable DOM utility library with a named-export entrypoint and eight query families. Browser objects belong to the consumer; the implementation binds queries to containers and obtains windows from supplied nodes. Configuration and retry bookkeeping live in memory, while diagnostics provide a limited Node filesystem integration. Distribution and CI are defined by npm metadata, inherited kcd-scripts configuration, and GitHub Actions.
- package.json directs CommonJS consumers to dist/index.js, ESM consumers to dist/@testing-library/dom.esm.js, UMD consumers to dist/@testing-library/dom.umd.js, and TypeScript consumers to types/index.d.ts; Node >=18 is declared. — [package.json#L1-L9](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/package.json#L1-L9) [package.json#L23-L25](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/package.json#L23-L25)
- src/index.js exports queries, asynchronous utilities, events, screen, diagnostics, configuration, and suggestions; within aliases getQueriesForElement, and queries/queryHelpers are also namespace exports. — [src/index.js#L1-L27](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/index.js#L1-L27)
- src/queries/index.ts aggregates LabelText, PlaceholderText, Text, DisplayValue, AltText, Title, Role, and TestId; buildQueries supplies shared variant construction for most families. — [src/queries/index.ts#L1-L8](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/queries/index.ts#L1-L8) [src/query-helpers.ts#L224-L256](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/query-helpers.ts#L224-L256) [src/queries/label-text.ts#L180-L204](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/queries/label-text.ts#L180-L204)
- screen binds document.body during module evaluation when available; explicit container APIs use getQueriesForElement, and event/wait helpers resolve the supplied node's owning window. — [src/screen.ts#L49-L64](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/screen.ts#L49-L64) [src/get-queries-for-element.js#L13-L22](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/get-queries-for-element.js#L13-L22) [src/helpers.ts#L28-L41](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/helpers.ts#L28-L41)
- The inspected state owners are module-level configuration, per-wait promise/timer/observer bookkeeping, and a per-role-query WeakMap; these paths keep state in memory rather than implementing durable storage. — [src/config.ts#L12-L24](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/config.ts#L12-L24) [src/config.ts#L64-L79](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/config.ts#L64-L79) [src/wait-for.js#L44-L49](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/wait-for.js#L44-L49) [src/queries/role.ts#L177-L184](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/queries/role.ts#L177-L184)
- Role semantics integrate aria-query and dom-accessibility-api; formatting uses pretty-format, playground URL generation uses lz-string, and Node code frames dynamically load fs, @babel/code-frame, and picocolors. — [src/queries/role.ts#L2-L10](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/queries/role.ts#L2-L10) [src/pretty-dom.js#L1-L5](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/pretty-dom.js#L1-L5) [src/screen.ts#L1-L21](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/screen.ts#L1-L21) [src/get-user-code-frame.js#L6-L17](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/get-user-code-frame.js#L6-L17)
- npm scripts delegate build, lint, tests, validation, and typechecking to kcd-scripts; build excludes test directories and performs a second bundled build, while Rollup explicitly requires named exports. — [package.json#L45-L60](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/package.json#L45-L60) [rollup.config.js#L1-L5](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/rollup.config.js#L1-L5) [tsconfig.json#L1-L8](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/tsconfig.json#L1-L8)
- GitHub validation targets Node 18 and 24; an upstream push can trigger a dependent production-environment build and semantic release, while a separate workflow runs an alt-text bot on supported community events. — [.github/workflows/validate.yml#L20-L54](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/.github/workflows/validate.yml#L20-L54) [.github/workflows/validate.yml#L63-L104](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/.github/workflows/validate.yml#L63-L104) [.github/workflows/accessibility-alt-text.yml#L1-L28](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/.github/workflows/accessibility-alt-text.yml#L1-L28) [other/MAINTAINING.md#L62-L70](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/other/MAINTAINING.md#L62-L70)

Every claim links to its cited files at the pinned commit. Citations identify source evidence; they do not establish runtime correctness. Independent CodeVetter scan — not reviewed by upstream maintainers.

## Public product links

- [CodeVetter](https://codevetter.com/)
- [Download](https://codevetter.com/download)
- [Documentation](https://codevetter.com/docs/)
- [Source](https://github.com/Codevetter/codevetter)
