@testing-library/jest-dom provides custom Jest matchers for asserting the state of DOM elements in your tests. It helps make DOM-related assertions more declarative and readable by extending Jest’s `expect`, and it supports use with different setup options such as Jest and Vitest.
Project status
- Actively maintained: the upstream repo has a recent push on 2026-05-06, and recent
testing-library/jest-domupdates (v6.8.0 through v6.9.1) show ongoing work. - Apparent cadence: recent version bumps within 2025 suggest a roughly monthly to 6-week rhythm (v6.8.0 on 2025-08-20, v6.9.0 on 2025-09-30, v6.9.1 on 2025-10-01).
AI summary generated Today
Recent updates
v6.9.1
8 months agov6.9.1 includes a fix intended to prevent a runtime error when the global `Node` object is undefined in Node.js environments. The code updates how document position constants are referenced, and it also makes small Jest configuration adjustments for the jsdom and node test setups.
v6.9.0
8 months agov6.9.0 adds two new DOM-order matchers, .toAppearBefore and .toAppearAfter, for asserting relative position in the DOM tree. The implementation is based on Node.compareDocumentPosition and includes corresponding TypeScript typings, Jest exports, tests, and README documentation.
Featuresv6.8.0
9 months agov6.8.0 adds a new Jest DOM matcher, `toBePartiallyPressed`, for checking ARIA `aria-pressed="mixed"` on pressable elements. The release notes only call out this new matcher, and the code diff confirms the matcher was added with TypeScript types, runtime implementation, tests, and README documentation.
Featuresv6.7.0
9 months agoRelease v6.7.0 adds the new `.toBePressed()` matcher for asserting `aria-pressed` state on button-like elements. In addition to the documented matcher addition, the codebase also includes internal refactors to how several other matchers compare values.
Featuresv6.6.4
10 months agov6.6.4 is a small release focused on a performance-oriented dependency swap. The release notes only call out replacing chalk with picocolors.
v6.6.3
10/31/2024v6.6.3 includes a small bug fix related to TypeScript type augmentation for Vitest matchers. The release primarily ensures the Vitest module is imported so the matcher extensions are picked up correctly.
v6.6.2
10/17/2024Release v6.6.2 is a small patch focused on TypeScript types for Vitest, specifically removing a recursive type reference. The only other changes are to contributor/credits metadata (all contributors config and README).
v6.6.1
10/16/2024Release v6.6.1 contains a single bug fix related to how lodash is imported in the to-have-selection matcher. The code change adjusts the lodash import specifier in src/to-have-selection.js.
v6.6.0
10/16/2024v6.6.0 adds a new matcher, toHaveSelection, to jest-dom. The release notes only mention the feature, but the code introduces a fully implemented matcher with specific selection behavior for inputs, textareas, and general text nodes, plus accompanying tests and documentation updates.
Featuresv6.5.0
8/23/2024v6.5.0 adds support for asserting aria-valuenow via the toHaveValue matcher for elements with certain ARIA roles. The code also includes additional, non-release-noted changes related to Vitest TypeScript typings and dependency configuration.
Features