Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-enzyme

Package Overview
Dependencies
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-enzyme

Testing Matchers for Enzyme

  • 2.1.2-beta1
  • beta
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
150K
decreased by-50.51%
Maintainers
1
Weekly downloads
 
Created

What is jest-enzyme?

The jest-enzyme package provides a set of custom matchers for using Enzyme with Jest, making it easier to write and read tests for React components.

What are jest-enzyme's main functionalities?

toBeChecked

This matcher checks if a checkbox input is checked.

expect(wrapper.find('input[type="checkbox"]').first()).toBeChecked();

toHaveClassName

This matcher checks if a component has a specific class name.

expect(wrapper.find('.my-class')).toHaveClassName('my-class');

toHaveStyle

This matcher checks if a component has a specific inline style.

expect(wrapper.find('div')).toHaveStyle('display', 'none');

toContainReact

This matcher checks if a component contains a specific React element.

expect(wrapper).toContainReact(<MyComponent />);

toHaveText

This matcher checks if a component contains specific text.

expect(wrapper.find('p')).toHaveText('Hello World');

Other packages similar to jest-enzyme

Keywords

FAQs

Package last updated on 04 Feb 2017

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