Irina Glushko 2389e7160b HW1 done | 3 年之前 | |
---|---|---|
.. | ||
dist | 3 年之前 | |
node_modules | 3 年之前 | |
types | 3 年之前 | |
CHANGELOG.md | 3 年之前 | |
LICENSE | 3 年之前 | |
README.md | 3 年之前 | |
package.json | 3 年之前 |
Simple and complete DOM testing utilities that encourage good testing practices.
[**Read the docs**](https://testing-library.com/dom) | [Edit the docs](https://github.com/testing-library/testing-library-docs)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.
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
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.
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):
This project follows the all-contributors specification. Contributions of any kind welcome!