Socket
Socket
Sign inDemoInstall

jest-dom

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-dom


Version published
Weekly downloads
119K
increased by3.38%
Maintainers
2
Weekly downloads
 
Created

What is jest-dom?

The jest-dom package provides a set of custom jest matchers that you can use to extend jest. These will make your tests more declarative, clear to read, and to maintain. You can use these matchers to test the state of the DOM in your tests.

What are jest-dom's main functionalities?

toBeInTheDocument

This matcher checks if an element is present in the document.

expect(element).toBeInTheDocument();

toHaveTextContent

This matcher checks if an element has a specific text content.

expect(element).toHaveTextContent('Hello World');

toBeVisible

This matcher checks if an element is visible to the user.

expect(element).toBeVisible();

toHaveAttribute

This matcher checks if an element has a specific attribute with a specific value.

expect(element).toHaveAttribute('type', 'button');

toHaveClass

This matcher checks if an element has a specific class.

expect(element).toHaveClass('btn-primary');

Other packages similar to jest-dom

FAQs

Package last updated on 08 Jul 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc