Giter Site home page Giter Site logo

azhariemuhammad / dom-testing-library Goto Github PK

View Code? Open in Web Editor NEW

This project forked from testing-library/dom-testing-library

0.0 1.0 0.0 662 KB

πŸ™ Simple and complete DOM testing utilities that encourage good testing practices.

Home Page: https://testing-library.com

License: MIT License

JavaScript 100.00%

dom-testing-library's Introduction

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):

Kent C. Dodds
Kent C. Dodds

πŸ’» πŸ“– πŸš‡ ⚠️
Greg BergΓ©
Greg BergΓ©

πŸ€”
Ryan Castner
Ryan Castner

πŸ“–
Daniel Sandiego
Daniel Sandiego

πŸ’»
PaweΕ‚ MikoΕ‚ajczyk
PaweΕ‚ MikoΕ‚ajczyk

πŸ’»
Alejandro ÑÑñez Ortiz
Alejandro ÑÑñez Ortiz

πŸ“–
Matt Parrish
Matt Parrish

πŸ› πŸ’» πŸ“– ⚠️
Justin Hall
Justin Hall

πŸ“¦
Anto Aravinth
Anto Aravinth

πŸ’» ⚠️ πŸ“–
Jonah Moses
Jonah Moses

πŸ“–
Łukasz Gandecki
Łukasz Gandecki

πŸ’» ⚠️ πŸ“–
Ivan Babak
Ivan Babak

πŸ› πŸ€” πŸ’» πŸ“–
Jesse Day
Jesse Day

πŸ’»
Ernesto GarcΓ­a
Ernesto GarcΓ­a

πŸ’¬ πŸ’» πŸ“–
Josef Maxx Blake
Josef Maxx Blake

πŸ’» πŸ“– ⚠️
Alex Cook
Alex Cook

πŸ“– πŸ’‘ πŸ‘€
Daniel Cook
Daniel Cook

πŸ’» πŸ“– ⚠️
Thomas Chia
Thomas Chia

πŸ› πŸ’»
Tim Deschryver
Tim Deschryver

πŸ’» ⚠️
Alex Krolick
Alex Krolick

πŸ’»
Maddi Joyce
Maddi Joyce

πŸ’»
Peter Kamps
Peter Kamps

πŸ› πŸ’» ⚠️
Jonathan Stoye
Jonathan Stoye

πŸ“–
Sanghyeon Lee
Sanghyeon Lee

πŸ’‘
Justice Mba
Justice Mba

πŸ’» πŸ“– πŸ€”
Wayne Crouch
Wayne Crouch

πŸ’»
Ben Elliott
Ben Elliott

πŸ’»
Ruben Costa
Ruben Costa

πŸ’»
Robert Smith
Robert Smith

πŸ› πŸ€” πŸ“–
dadamssg
dadamssg

πŸ’»
Neil Kistner
Neil Kistner

πŸ’»
Ben Chauvette
Ben Chauvette

πŸ’»
Jeff Baumgardt
Jeff Baumgardt

πŸ’» πŸ“–
Matan Kushner
Matan Kushner

πŸ’» πŸ“– πŸ€” ⚠️
Alex Wendte
Alex Wendte

πŸ’» πŸ“– ⚠️
Tamas Fodor
Tamas Fodor

πŸ“–
Benjamin Eckardt
Benjamin Eckardt

πŸ’»
Ryan Campbell
Ryan Campbell

πŸ“–
Taylor Briggs
Taylor Briggs

⚠️
John Gozde
John Gozde

πŸ’»
C. T. Lin
C. T. Lin

πŸ“–
Terrence Wong
Terrence Wong

πŸ’»
Soo Jae Hwang
Soo Jae Hwang

πŸ’»
Royston Shufflebotham
Royston Shufflebotham

πŸ› πŸ’» πŸ“– ⚠️
Vadim Brodsky
Vadim Brodsky

πŸ’»
Eunjae Lee
Eunjae Lee

πŸ’»
David Peter
David Peter

πŸ’»
Shy Alter
Shy Alter

πŸ’» πŸ“–
Łukasz Makuch
Łukasz Makuch

πŸ“¦
Tyler Haas
Tyler Haas

πŸ’» ⚠️
Vesa Laakso
Vesa Laakso

πŸ’» ⚠️
Tulsi Sapkota
Tulsi Sapkota

πŸ’»
Tiago Nunes
Tiago Nunes

πŸ’» ⚠️
JaxCavalera
JaxCavalera

πŸ’» πŸ‘€
bopfer
bopfer

⚠️
Jan Pfitzner
Jan Pfitzner

πŸ’»
David
David

πŸ’»
Diego Hernandez
Diego Hernandez

πŸ’» ⚠️
Alex Young
Alex Young

πŸ’»
Paul Armstrong
Paul Armstrong

πŸ’» ⚠️
TamΓ‘s SzabΓ³
TamΓ‘s SzabΓ³

πŸ’» ⚠️
Dylan Piercey
Dylan Piercey

πŸ’» ⚠️
Michael Lasky
Michael Lasky

πŸ’» ⚠️ πŸ“–
Sebastian Silbermann
Sebastian Silbermann

πŸ’» ⚠️
Dylan Vann
Dylan Vann

πŸ’»
AdriΓ  Fontcuberta
AdriΓ  Fontcuberta

πŸ’» ⚠️ πŸ“–
Thomas Lombart
Thomas Lombart

πŸ’»
Sam Horton
Sam Horton

πŸ’» ⚠️
Andrew Hill
Andrew Hill

πŸ’»

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

LICENSE

MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.