jest-dom: Detailed Overview & Metrics

v6.4.6(24 days ago)

This package is actively maintained.Types definitions are bundled with the npm packageNumber of direct dependencies: 8Monthly npm downloads

@testing-library/jest-dom is a companion library for Jest that provides custom Jest matchers for asserting on DOM elements. It enhances the testing experience by offering a set of custom matchers specifically designed for testing the state of the DOM, such as checking for element visibility, text content, CSS classes, and more. This library promotes best practices for testing user interfaces and encourages writing tests that closely resemble how users interact with the application.

Compared to other testing libraries, @testing-library/jest-dom focuses on testing the DOM behavior and interactions, making it a valuable tool for ensuring the correctness of user interface components in a more user-centric way.

Alternatives: @testing-library/react, enzyme, react-testing-library

Tags: javascripttestingjestdomuser-interface