# testing-library/dom-testing-library

🐙 Simple and complete DOM testing utilities that encourage good testing practices.

Repository: https://github.com/testing-library/dom-testing-library
Canonical: https://ross.abutalabs.com/products/dom-testing-library
Homepage: https://testing-library.com/dom
Language: JavaScript
License: MIT
License Family: permissive
Topics: javascript, testing
Last push: 2025-11-12T11:24:25+00:00

## Health v2 (maintenance only)
Score: 46/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 51, release rhythm 8, longevity 100
- inputs: {"age_days": 3071, "days_push": 294, "days_rel": 402, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3332, forks 473 (observed 2026-08-28T04:07:56.646220+00:00)

## What it is
DOM Testing Library is a lightweight JavaScript library providing utilities for querying and interacting with DOM nodes in tests, in a way that mimics how real users find elements (by label text, role, visible text). It is the core API of the Testing Library family, with framework wrappers for React, Vue, Angular, and others, and works with any test runner that provides DOM APIs such as Jest with JSDOM.

## Use cases
- test web ui components in a user-centric way
- query dom elements by label text or aria role in tests
- write maintainable frontend tests that survive refactors
- simulate user events and wait for async dom updates
- test react vue or angular components with testing library
- improve accessibility by testing with semantic queries

## When to choose
- you want user-centric UI tests that avoid implementation details
- you need framework-agnostic DOM query utilities for Jest, Vitest, Mocha, or a real browser
- you want tests that double as accessibility checks

## When to avoid
- you need a test runner or assertion framework - it is neither
- you are testing non-DOM code such as Node backend logic
- you want snapshot or implementation-detail testing of component internals

## Facets
- artifact type: library
- maturity: active
- function: testing, e2e-testing, ui-components
- domain: testing, frontend, web-development, accessibility, developer-tools
- platform: browser
- tags: dom-testing, jsdom, jest, user-centric-testing, queries, accessibility-testing, nodejs, javascript

## Member repositories
- testing-library/dom-testing-library (main) score 46

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:56.646220+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:41:41.925299+00:00, confidence not recorded.
  - readme: https://github.com/testing-library/dom-testing-library (fetched 2026-08-28T04:07:56.646220+00:00, sha dcb5add1f695)
  - homepage: https://testing-library.com/dom (fetched 2026-08-29T09:34:54.414171+00:00, sha 273a42fd0eae)
  - site_page: https://testing-library.com/docs (fetched 2026-08-29T09:34:54.416927+00:00, sha 294680c6ca00)
  - site_page: https://testing-library.com/docs/recipes (fetched 2026-08-29T09:34:54.418758+00:00, sha e707259ba080)
  - site_page: https://testing-library.com/docs/queries/about (fetched 2026-08-29T09:34:54.421409+00:00, sha 1bb7d31eef5f)
  - site_page: https://testing-library.com/docs/dom-testing-library/install (fetched 2026-08-29T09:34:54.424256+00:00, sha b4fe2d48b8ff)
  - site_page: https://testing-library.com/docs/dom-testing-library/example-intro (fetched 2026-08-29T09:34:54.426377+00:00, sha 74efd7216bdf)
  - site_page: https://testing-library.com/docs/dom-testing-library/setup (fetched 2026-08-29T09:34:54.428133+00:00, sha 6a9e234b6db1)
  - site_page: https://testing-library.com/docs/dom-testing-library/api (fetched 2026-08-29T09:34:54.429613+00:00, sha 5f52c3045698)
  - site_page: https://testing-library.com/docs/dom-testing-library/cheatsheet (fetched 2026-08-29T09:34:54.431333+00:00, sha 098883e9d7a9)
- Data as of 2026-08-30T08:39:29.467469+00:00.
