# Extension points — testing-library/dom-testing-library

> Canonical page: https://codevetter.com/unpack/dom-testing-library/extension-points

# Extension points — 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 library exposes factories and wrappers as extension mechanisms for consumers and framework adapters. Query families plug into export tables, and custom query maps can be bound without modifying the default registry. Event shortcuts derive from a declarative map, while configuration injects scheduling, dispatch, and diagnostic behavior. Public declarations form a parallel extension contract that must remain aligned with runtime behavior.
- New built-in query families plug into src/queries/index.ts; that namespace feeds the public entrypoint and screen, so its runtime exports must remain query functions. — [src/queries/index.ts#L1-L8](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/queries/index.ts#L1-L8) [src/index.js#L1-L5](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/index.js#L1-L5) [src/screen.ts#L5-L8](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/screen.ts#L5-L8) [src/config.ts#L9-L11](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/config.ts#L9-L11)
- buildQueries accepts an all-query plus multiple/missing error functions and produces five variants; Text illustrates this pattern, while LabelText deliberately assembles variants separately for richer errors. — [src/query-helpers.ts#L212-L256](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/query-helpers.ts#L212-L256) [src/queries/text.ts#L48-L75](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/queries/text.ts#L48-L75) [src/queries/label-text.ts#L124-L164](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/queries/label-text.ts#L124-L164) [src/queries/label-text.ts#L180-L204](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/queries/label-text.ts#L180-L204)
- getQueriesForElement accepts a custom function map and optional initial object; consumer tests demonstrate extending default queries, and type fixtures bind a custom AutomationId family through within. — [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/__tests__/get-queries-for-element.js#L10-L30](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/__tests__/get-queries-for-element.js#L10-L30) [types/__tests__/type-tests.ts#L121-L134](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/types/__tests__/type-tests.ts#L121-L134)
- queryAllByAttribute supplies normalized attribute matching, while exported makeSingleQuery, makeGetAllQuery, makeFindQuery, and suggestion wrappers allow custom composition below buildQueries. — [src/query-helpers.ts#L29-L41](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/query-helpers.ts#L29-L41) [src/query-helpers.ts#L259-L269](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/query-helpers.ts#L259-L269) [src/index.js#L13-L17](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/index.js#L13-L17)
- configure injects asyncWrapper, unstable_advanceTimersWrapper, and eventWrapper; waitFor and fireEvent invoke these hooks, and source comments identify framework act integration as their purpose. — [src/config.ts#L15-L24](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/config.ts#L15-L24) [src/wait-for.js#L51-L82](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/wait-for.js#L51-L82) [src/wait-for.js#L183-L189](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/wait-for.js#L183-L189) [src/events.js#L5-L18](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/events.js#L5-L18) [types/config.d.ts#L3-L11](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/types/config.d.ts#L3-L11)
- eventMap entries define constructor type and default initialization, automatically generating createEvent/fireEvent methods; eventAliasMap supplies alias dispatch such as doubleClick. — [src/event-map.js#L58-L83](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/event-map.js#L58-L83) [src/event-map.js#L385-L387](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/event-map.js#L385-L387) [src/events.js#L95-L101](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/events.js#L95-L101) [src/events.js#L125-L128](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/events.js#L125-L128)
- Diagnostics can be customized through configure.getElementError, prettyDOM's filterNode and pretty-format options, and waitFor's onTimeout/mutationObserverOptions; these hooks affect failure output and retry observation. — [src/config.ts#L35-L47](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/config.ts#L35-L47) [src/pretty-dom.js#L80-L90](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/pretty-dom.js#L80-L90) [src/wait-for.js#L20-L37](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/wait-for.js#L20-L37) [types/config.d.ts#L19-L26](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/types/config.d.ts#L19-L26)
- Matcher functions and normalizers customize matching, but normalizer cannot be combined directly with trim/collapseWhitespace; type-level extension uses QueryMethod, BuiltQueryMethods, and BoundFunctions to preserve custom argument and result types. — [src/matches.ts#L43-L61](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/matches.ts#L43-L61) [src/matches.ts#L89-L111](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/src/matches.ts#L89-L111) [types/query-helpers.d.ts#L40-L74](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/types/query-helpers.d.ts#L40-L74) [types/get-queries-for-element.d.ts#L3-L8](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/types/get-queries-for-element.d.ts#L3-L8) [types/get-queries-for-element.d.ts#L156-L182](https://github.com/testing-library/dom-testing-library/blob/6049cc0bc7cf2201625c476c95fa6299d0e2fa8b/types/get-queries-for-element.d.ts#L156-L182)

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)
