Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chuntley/dom-testing-extended
Added flexibility to dom-testing-library
https://github.com/chuntley/dom-testing-extended
Last synced: 22 days ago
JSON representation
Added flexibility to dom-testing-library
- Host: GitHub
- URL: https://github.com/chuntley/dom-testing-extended
- Owner: chuntley
- License: mit
- Created: 2019-05-29T16:55:24.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-05-29T18:20:52.000Z (over 5 years ago)
- Last Synced: 2024-10-02T08:57:16.393Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 553 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
dom-testing-library
Simple and complete DOM testing utilities that encourage good testing practices.
[**Read the docs**](https://testing-library.com/) | [Edit the docs](https://github.com/testing-library/testing-library-docs)
[![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](https://img.shields.io/badge/all_contributors-58-orange.svg?style=flat-square)](#contributors)
[![PRs Welcome][prs-badge]][prs]
[![Code of Conduct][coc-badge]][coc][![Watch on GitHub][github-watch-badge]][github-watch]
[![Star on GitHub][github-star-badge]][github-star]
[![Tweet][twitter-badge]][twitter]## Table of Contents
- [The Problem](#the-problem)
- [This Solution](#this-solution)
- [Installation](#installation)
- [Implementations](#implementations)
- [Other Solutions](#other-solutions)
- [Guiding Principles](#guiding-principles)
- [Contributors](#contributors)
- [LICENSE](#license)## 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`](https://github.com/jsdom/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]
## Installation
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 dom-testing-library
```> [**Docs**](https://testing-library.com/docs/install)
## Implementations
This library was not built to be used on its own. The original implementation
of these utilities was in the `react-testing-library`.Implementations include:
- [`react-testing-library`](https://github.com/kentcdodds/react-testing-library)
- [`pptr-testing-library`](https://github.com/patrickhulce/pptr-testing-library)
- [`cypress-testing-library`](https://github.com/kentcdodds/cypress-testing-library)
- [`vue-testing-library`](https://github.com/dfcook/vue-testing-library)
- [`snabbdom-testing-library`](https://github.com/lukaszmakuch/snabbdom-testing-library)## Other Solutions
- [browser-monkey](https://github.com/featurist/browser-monkey)
## Guiding Principles
> [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: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][emojis]):
Kent C. Dodds
π» π π β οΈ
Ryan Castner
π
Daniel Sandiego
π»
PaweΕ MikoΕajczyk
π»
Alejandro ΓÑñez Ortiz
π
Matt Parrish
π π» π β οΈ
Justin Hall
π¦
Anto Aravinth
π» β οΈ π
Jonah Moses
π
Εukasz Gandecki
π» β οΈ π
Ivan Babak
π π€ π» π
Jesse Day
π»
Ernesto GarcΓa
π¬ π» π
Josef Maxx Blake
π» π β οΈ
Alex Cook
π π‘ π
Daniel Cook
π» π β οΈ
Thomas Chia
π π»
Tim Deschryver
π» β οΈ
Alex Krolick
π»
Maddi Joyce
π»
Peter Kamps
π π» β οΈ
Jonathan Stoye
π
Sanghyeon Lee
π‘
Justice Mba
π» π π€
Wayne Crouch
π»
Ben Elliott
π»
Ruben Costa
π»
Robert Smith
π π€ π
dadamssg
π»
Neil Kistner
π»
Ben Chauvette
π»
Jeff Baumgardt
π» π
Matan Kushner
π» π π€ β οΈ
Alex Wendte
π» π β οΈ
Tamas Fodor
π
Benjamin Eckardt
π»
Ryan Campbell
π
Taylor Briggs
β οΈ
John Gozde
π»
C. T. Lin
π
Terrence Wong
π»
Soo Jae Hwang
π»
Royston Shufflebotham
π π» π β οΈ
Vadim Brodsky
π»
Eunjae Lee
π»
David Peter
π»
Shy Alter
π» π
Εukasz Makuch
π¦
Tyler Haas
π» β οΈ
Vesa Laakso
π» β οΈ
Tulsi Sapkota
π»
Tiago Nunes
π» β οΈ
JaxCavalera
π» π
bopfer
β οΈ
Jan Pfitzner
π»
David
π»
Diego Hernandez
π» β οΈ
Greg BergΓ©
π€This project follows the [all-contributors][all-contributors] specification.
Contributions of any kind welcome!## LICENSE
MIT
[npm]: https://www.npmjs.com/
[node]: https://nodejs.org
[build-badge]: https://img.shields.io/travis/testing-library/dom-testing-library.svg?style=flat-square
[build]: https://travis-ci.org/testing-library/dom-testing-library
[coverage-badge]: https://img.shields.io/codecov/c/github/testing-library/dom-testing-library.svg?style=flat-square
[coverage]: https://codecov.io/github/testing-library/dom-testing-library
[version-badge]: https://img.shields.io/npm/v/dom-testing-library.svg?style=flat-square
[package]: https://www.npmjs.com/package/dom-testing-library
[downloads-badge]: https://img.shields.io/npm/dm/dom-testing-library.svg?style=flat-square
[npmtrends]: http://www.npmtrends.com/dom-testing-library
[license-badge]: https://img.shields.io/npm/l/dom-testing-library.svg?style=flat-square
[license]: https://github.com/testing-library/dom-testing-library/blob/master/LICENSE
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square
[prs]: http://makeapullrequest.com
[donate-badge]: https://img.shields.io/badge/$-support-green.svg?style=flat-square
[coc-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square
[coc]: https://github.com/testing-library/dom-testing-library/blob/master/CODE_OF_CONDUCT.md
[github-watch-badge]: https://img.shields.io/github/watchers/testing-library/dom-testing-library.svg?style=social
[github-watch]: https://github.com/testing-library/dom-testing-library/watchers
[github-star-badge]: https://img.shields.io/github/stars/testing-library/dom-testing-library.svg?style=social
[github-star]: https://github.com/testing-library/dom-testing-library/stargazers
[twitter]: https://twitter.com/intent/tweet?text=Check%20out%20dom-testing-library%20by%20%40testing-library%20https%3A%2F%2Fgithub.com%2Ftesting-library%2Fdom-testing-library%20%F0%9F%91%8D
[twitter-badge]: https://img.shields.io/twitter/url/https/github.com/testing-library/dom-testing-library.svg?style=social
[emojis]: https://github.com/all-contributors/all-contributors#emoji-key
[all-contributors]: https://github.com/all-contributors/all-contributors
[set-immediate]: https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate
[guiding-principle]: https://twitter.com/kentcdodds/status/977018512689455106
[jest]: https://facebook.github.io/jest