On this page
Overview
DOM Testing Library is a lightweight set of utilities for testing DOM nodes. Instead of relying on component instances or implementation details, it encourages queries that resemble how users find elements on the page, making UI tests more resilient to refactoring.
Features and best fit
Based on official documentation; not hands-on tested · Content checked:
Key features
Test DOM nodes in JSDOM or a browser environment
The library works with DOM nodes rather than framework-specific component instances and focuses assertions on user-visible UI.
Sources: [1]
Provide the user-centric foundation used by framework wrappers
React, Vue, Angular, and other wrappers build on the same DOM-oriented testing principles while adding framework integration.
Sources: [1]
Best fit
Fits UI tests that should verify behavior instead of implementation details
It is useful when tests should survive internal component refactors as long as the visible behavior remains the same.
Sources: [1]
Before adoption
The v10.4.2 package metadata requires Node.js 18 or newer
Check the selected test runner, JSDOM version, and surrounding toolchain against the target Node.js runtime before adoption.
Sources: [2]
Official sources
- [1]DOM Testing Library v10.4.2 README(2026-10-06)
- [2]DOM Testing Library v10.4.2 package metadata(2026-10-06)
- [3]DOM Testing Library v10.4.2 release(2026-10-06)
Supplemental curator note
DOM Testing Library fits UI tests that should remain stable when internal component implementation changes but user-visible behavior does not. The v10.4.2 package metadata requires Node.js 18 or newer.
Try it in 3 steps
- 1
Get the source
git clone --depth 1 https://github.com/testing-library/dom-testing-library.git - 2
Enter the repository
cd dom-testing-library - 3
Check the official steps
Continue with the commands in the README Installation, Quick Start, or Getting Started section.
find . -maxdepth 1 -iname 'README*' -exec sed -n '1,220p' {} \; -quit
Growth
Growth trends · Last 30 days
3,335 Stars
Trend data is still being collected.
Built with
Categories and tags
Categories
GitHub data
GitHub dataView detailed GitHub data
GitHub Topics
- javascript
- testing
- Stars
- 3,335
- Forks
- 473
- Watchers
- 30
- Open issues
- 132
- Owner type
- Organization
- Primary language
- JavaScript
- License
- MIT
- Repository last updated
- Sep 15, 2026
Related information
Write a related articleShare a guide or use case for this OSS in Markdown. Articles are published after administrator approval.
Explore next
- Jest45,500 Stars
3 shared tag(s) · 1 shared category(s)
Combine assertions, mocks, watch mode, snapshots, coverage, and worker isolation in one JavaScript test runner
TypeScript - Video.js39,907 Stars
3 shared tag(s) · Same language
add a shared player UI and API to HTML5 video, including web streaming formats such as HLS and DASH
JavaScript - SortableJS31,186 Stars
3 shared tag(s) · Same language
reorder list items with drag and drop within or across lists while supporting touch input
JavaScript - Nano ID27,076 Stars
3 shared tag(s) · Same language
generate short URL-safe IDs from cryptographic randomness and tune the alphabet and length for each use case
JavaScript - localForage25,809 Stars
3 shared tag(s) · Same language
use IndexedDB and other browser persistence through an asynchronous localStorage-like API
JavaScript - PhotoSwipe25,270 Stars
3 shared tag(s) · Same language
open image galleries in a lightbox with swipe, zoom, and dynamic loading across mobile and desktop
JavaScript
Report incorrect information
Tell us if any listing information is incorrect or outdated.