testing-library/jest-dom

:owl: Custom jest matchers to test the state of the DOM

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 35 seconds ago
Added to GitGenius on September 15th, 2026
Created on April 9th, 2018
Open Issues & Pull Requests: 147 (+0)
GitHub issues: Enabled
Number of forks: 422
Total Stargazers: 4,597 (+0)
Total Subscribers: 32 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 7.8 days
Mean response time: 175.6 days
90th percentile: 552.8 days
Tracked items: 48

Most active contributors

Sign in to see contributor activity.

How this project is maintained

100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Three people close 75% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 41
New in 7 days: 1
Closed in 7 days: 0
Avg open age: 836 days
Stale 30+ days: 37
Stale 90+ days: 35

Recent activity

Opened in 7 days: 1
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • good first issue (5)
  • released (5)
  • bug (4)
  • enhancement (4)
  • help wanted (2)
  • needs discussion (2)
  • jsdom (1)
  • semantic-release (1)

Detailed Description

jest-dom is a custom Jest matcher library that extends Jest with assertions for testing the state of the DOM.

The problem it solves is the repetitive patterns that arise when writing DOM assertions in tests. Developers need to repeatedly check element attributes, text content, CSS classes, and other DOM properties. jest-dom addresses this by providing a set of custom matchers that make these assertions more declarative and readable. Instead of writing verbose helper functions or complex assertion chains, developers can use semantic matchers like toBeDisabled, toBeVisible, toHaveClass, and toHaveAttribute that directly express intent.

Jest users writing DOM tests should adopt this tool, particularly those using React Testing Library or other testing-library packages. It suits any project that uses Jest and needs to assert on DOM state, from component unit tests to integration tests. The matchers cover accessibility concerns like toHaveAccessibleName and toHaveAccessibleDescription, form validation states like toBeValid and toBeRequired, and visual properties like toBeVisible. The library also supports TypeScript and works with Vitest and other Jest-compatible expect implementations.

The project maintains active development with regular updates to its matcher suite. The tool receives ongoing refinement of existing matchers and addition of new ones to cover emerging testing patterns. The codebase demonstrates sustained attention to both functionality and test coverage. Development activity shows consistent engagement with the testing community's needs and evolving best practices around DOM testing.