🌜
🌞
@pre-bundled/testing-library-dom

@pre-bundled/testing-library-dom

v7.5.2-patch-4

Simple and complete DOM testing utilities that encourage good testing practices.

npm install @pre-bundled/testing-library-dom

README

DOM Testing Library

octopus

Simple and complete DOM testing utilities that encourage good testing practices.

Read the docs | Edit the docs


Build Status Code Coverage version downloads MIT License

All Contributors PRs Welcome Code of Conduct

Watch on GitHub Star on GitHub Tweet

Table of Contents

The Problem

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.

This Solution

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.

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's devDependencies:

npm install --save-dev @testing-library/dom

Docs

Documentation

Read the docs (and discover framework and tool-specific implementations) at testing-library.com

Guiding Principles

The more your tests resemble the way your software is used, the more confidence they can give you.

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:

  1. If it relates to rendering components, it deals with DOM nodes rather than component instances, nor should it encourage dealing with component instances.
  2. It should be generally useful for testing the application components in the way the user would use it. We are making some trade-offs here because we're using a computer and often a simulated browser environment, but in general, utilities should encourage tests that use the components the way they're intended to be used.
  3. Utility implementations and APIs should be simple and flexible.

At the end of the day, what we want is for this library to be pretty light-weight, simple, and understandable.

Contributors

Thanks goes to these people (emoji key):

contributor
Kent C. Dodds

💻 📖 🚇 ⚠️
contributor
Greg Bergé

🤔
contributor
Ryan Castner

📖
contributor
Daniel Sandiego

💻
contributor
Paweł Mikołajczyk

💻
contributor
Alejandro Ñáñez Ortiz

📖
contributor
Matt Parrish

🐛 💻 📖 ⚠️
contributor
Justin Hall

📦
contributor
Anto Aravinth

💻 ⚠️ 📖
contributor
Jonah Moses

📖
contributor
Łukasz Gandecki

💻 ⚠️ 📖
contributor
Ivan Babak

🐛 🤔 💻 📖
contributor
Jesse Day

💻
contributor
Ernesto García

💬 💻 📖
contributor
Josef Maxx Blake

💻 📖 ⚠️
contributor
Alex Cook

📖 💡 👀
contributor
Daniel Cook

💻 📖 ⚠️
contributor
Thomas Chia

🐛 💻
contributor
Tim Deschryver

💻 ⚠️
contributor
Alex Krolick

💻
contributor
Maddi Joyce

💻
contributor
Peter Kamps

🐛 💻 ⚠️
contributor
Jonathan Stoye

📖 💻
contributor
Sanghyeon Lee

💡
contributor
Justice Mba

💻 📖 🤔
contributor
Wayne Crouch

💻
contributor
Ben Elliott

💻
contributor
Ruben Costa

💻
contributor
Robert Smith

🐛 🤔 📖
contributor
dadamssg

💻
contributor
Neil Kistner

💻
contributor
Ben Chauvette

💻
contributor
Jeff Baumgardt

💻 📖
contributor
Matan Kushner

💻 📖 🤔 ⚠️
contributor
Alex Wendte

💻 📖 ⚠️
contributor
Tamas Fodor

📖
contributor
Benjamin Eckardt

💻
contributor
Ryan Campbell

📖
contributor
Taylor Briggs

⚠️
contributor
John Gozde

💻
contributor
C. T. Lin

📖
contributor
Terrence Wong

💻
contributor
Soo Jae Hwang

💻
contributor
Royston Shufflebotham

🐛 💻 📖 ⚠️
contributor
Vadim Brodsky

💻
contributor
Eunjae Lee

💻
contributor
David Peter

💻
contributor
Shy Alter

💻 📖
contributor
Łukasz Makuch

📦
contributor
Tyler Haas

💻 ⚠️
contributor
Vesa Laakso

💻 ⚠️
contributor
Tulsi Sapkota

💻
contributor
Tiago Nunes

💻 ⚠️
contributor
JaxCavalera

💻 👀
contributor
bopfer

⚠️
contributor
Jan Pfitzner

💻
contributor
David

💻
contributor
Diego Hernandez

💻 ⚠️
contributor
Alex Young

💻
contributor
Paul Armstrong

💻 ⚠️
contributor
Tamás Szabó

💻 ⚠️
contributor
Dylan Piercey

💻 ⚠️
contributor
Michael Lasky

💻 ⚠️ 📖
contributor
Sebastian Silbermann

💻 ⚠️ 📖 🚇
contributor
Dylan Vann

💻
contributor
Adrià Fontcuberta

💻 ⚠️ 📖
contributor
Thomas Lombart

💻
contributor
Sam Horton

💻 ⚠️
contributor
Andrew Hill

💻
contributor
Jan Amann

💻 ⚠️
contributor
Brais Piñeiro

💻 ⚠️
contributor
Dominykas Blyžė

💻 ⚠️
contributor
Olzhas Askar

💻 ⚠️ 📖
contributor
Max Belsky

💻 ⚠️
contributor
Michael Mantel

⚠️
contributor
Tom Nagle

💻
contributor
Westbrook Johnson

💻
contributor
Mohammad Aziz

💻 ⚠️
contributor
seetdev

⚠️ 💻
contributor
Xavier Garcia Buils

💻 ⚠️
contributor
aw-davidson

💻 ⚠️
contributor
Michaël De Boey

💻
contributor
Minh Nguyen

💻
contributor
Egill Sveinbjörnsson

💻
contributor
Pavel Pustovalov

📖
contributor
Adam Palaniuk

💻 ⚠️
contributor
Yama-Tomo

💻 ⚠️
contributor
Aaron Pettengill

💻 ⚠️
contributor
Kate W. Boyd

💻
contributor
Rahul Suryakanth

💻 ⚠️
contributor
Jamie

💻 ⚠️
contributor
Nicolas Stepien

💻
contributor
Ken Powers

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

LICENSE

MIT

General

License
MIT
Typescript Types
Built-in
Tree-shakeable
Yes

Popularity

GitHub Stargazers
2,976
Community Interest
3,159
Number of Forks
440

Maintenance

Commits
10/219/22015
Last Commit
Open Issues
52
Closed Issues
457
Open Pull Requests
18
Closed Pull Requests
74

Versions

Versions Released
10/219/2201
Latest Version Released
May 13, 2020
Current Tags
latest7.5.2-patch-4

Contributors

kentcdodds
kentcdodds
Commits: 97
eps1lon
eps1lon
Commits: 39
alexkrolick
alexkrolick
Commits: 21
marcosvega91
marcosvega91
Commits: 15
allcontributors[bot]
allcontributors[bot]
Commits: 13
gnapse
gnapse
Commits: 12
timdeschryver
timdeschryver
Commits: 10
MichaelDeBoey
MichaelDeBoey
Commits: 10
nickmccurdy
nickmccurdy
Commits: 9
RoystonS
RoystonS
Commits: 6
benmonro
benmonro
Commits: 5
SimenB
SimenB
Commits: 4
pheeria
pheeria
Commits: 3
smeijer
smeijer
Commits: 3
sheerun
sheerun
Commits: 3