Back to Explore

testing-library/jest-dom

GitHub
2 updates · last 90 days1 watchersOpen source

Last release:

@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 repository shows a very recent upstream push on 2026-07-20, with multiple updates in the same day (v7.0.0 and v6.10.0), indicating ongoing work rather than dormancy.
  • Update cadence: After a long quieter period (next older update noted is 2025-10-01), updates resumed strongly in mid/late July 2026 with at least two versions released within minutes, suggesting an active release burst.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v7.0.0

    Release v7.0.0 is documented as adding new query matchers (toContainAnyBy* and toContainOneBy*), and it introduces breaking dependency requirements, making @testing-library/dom a required peer dependency and raising the minimum supported Node.js version to 22. However, the provided code diff does not show the matcher additions or the dependency enforcement changes; it only updates a manual release bookkeeping file.

    BreakingFeatures
  • v6.10.0

    v6.10.0 adds new Testing Library query based matchers, `toContainAnyBy*` and `toContainOneBy*`, for alt text, display value, label text, placeholder text, role, test id, text, and title. The implementation introduces a new dynamic matcher factory (`src/query-matchers.js`) and adds both runtime tests and TypeScript typings. In addition to the documented matcher feature, the release also changes package runtime requirements via Node engine and introduces a new peer dependency.

    Features
  • v6.9.1

    v6.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

    v6.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.

    Features
  • v6.8.0

    v6.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.

    Features
  • v6.7.0

    Release 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.

    Features
  • v6.6.4

    v6.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

    v6.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

    Release 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

    Release 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

    v6.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.

    Features
  • v6.5.0

    v6.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