Gathering detailed insights and metrics for @testing-library/dom
Gathering detailed insights and metrics for @testing-library/dom
Gathering detailed insights and metrics for @testing-library/dom
Gathering detailed insights and metrics for @testing-library/dom
@testing-library/jest-dom
Custom jest matchers to test the state of the DOM
@testing-library/react
Simple and complete React DOM testing utilities that encourage good testing practices.
@testing-library/user-event
Fire events the same way the user does
@types/testing-library__jest-dom
Stub TypeScript definitions entry for @testing-library/jest-dom, which provides its own types definitions
🐙 Simple and complete DOM testing utilities that encourage good testing practices.
npm install @testing-library/dom
Typescript
Module System
Min. Node Version
Node Version
NPM Version
97.9
Supply Chain
99.6
Quality
86.1
Maintenance
100
Vulnerability
100
License
JavaScript (77.41%)
TypeScript (22.59%)
Total Downloads
2,625,642,847
Last Day
872,074
Last Week
19,776,236
Last Month
84,870,561
Last Year
879,435,238
MIT License
3,309 Stars
654 Commits
469 Forks
31 Watchers
3 Branches
197 Contributors
Updated on Jul 02, 2025
Minified
Minified + Gzipped
Latest Version
10.4.0
Package Id
@testing-library/dom@10.4.0
Unpacked Size
2.32 MB
Size
423.96 kB
File Count
51
NPM Version
10.7.0
Node Version
18.20.4
Published on
Jul 22, 2024
Cumulative downloads
Total Downloads
Last Day
-13.3%
872,074
Compared to previous day
Last Week
-8%
19,776,236
Compared to previous week
Last Month
2.7%
84,870,561
Compared to previous month
Last Year
29.7%
879,435,238
Compared to previous year
Simple and complete DOM testing utilities that encourage good testing practices.
[![Build Status][build-badge]][build] [![Code Coverage][coverage-badge]][coverage] [![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends] [![MIT License][license-badge]][license] ![All Contributors][all-contributors-badge] [![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc] [![Discord][discord-badge]][discord]
[![Watch on GitHub][github-watch-badge]][github-watch] [![Star on GitHub][github-star-badge]][github-star] [![Tweet][twitter-badge]][twitter]
You want to write maintainable tests for your Web UI. As a part of this goal, you want your tests to avoid including implementation details of your components and rather focus on making your tests give you the confidence for which they are intended. As part of this, you want your testbase to be maintainable in the long run so refactors of your components (changes to implementation but not functionality) don't break your tests and slow you and your team down.
The DOM Testing Library
is a very light-weight solution for testing DOM nodes
(whether simulated with JSDOM
as provided by
default with [Jest][] or in the browser). The main utilities it provides involve
querying the DOM for nodes in a way that's similar to how the user finds
elements on the page. In this way, the library helps ensure your tests give you
confidence in your UI code. The DOM Testing Library
's primary guiding
principle is:
[The more your tests resemble the way your software is used, the more confidence they can give you.][guiding-principle]
This module is distributed via [npm][npm] which is bundled with [node][node] and
should be installed as one of your project's devDependencies
:
npm install --save-dev @testing-library/dom
Read the docs (and discover framework and tool-specific implementations) at testing-library.com
[The more your tests resemble the way your software is used, the more confidence they can give you.][guiding-principle]
We try to only expose methods and utilities that encourage you to write tests that closely resemble how your web pages are used.
Utilities are included in this project based on the following guiding principles:
At the end of the day, what we want is for this library to be pretty light-weight, simple, and understandable.
Thanks goes to these people ([emoji key][emojis]):
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
GitHub workflow tokens follow principle of least privilege
Details
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 16/22 approved changesets -- score normalized to 7
Reason
0 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More