Socket
Socket
Sign inDemoInstall

@emotion/jest

Package Overview
Dependencies
Maintainers
4
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emotion/jest

Jest utilities for emotion


Version published
Weekly downloads
188K
decreased by-39.7%
Maintainers
4
Weekly downloads
 
Created

What is @emotion/jest?

@emotion/jest is a package that provides custom Jest matchers for testing Emotion styles. It allows you to write tests that can check if your components have the correct styles applied, making it easier to ensure that your styled components behave as expected.

What are @emotion/jest's main functionalities?

toHaveStyleRule

The `toHaveStyleRule` matcher allows you to check if a component has a specific style rule applied. This is useful for ensuring that your styled components have the correct styles.

const { toHaveStyleRule } = require('@emotion/jest');
expect.extend({ toHaveStyleRule });

// Example usage
import styled from '@emotion/styled';

const Button = styled.button`
  color: hotpink;
`;

// In your test file
expect(Button).toHaveStyleRule('color', 'hotpink');

Other packages similar to @emotion/jest

Keywords

FAQs

Package last updated on 20 Jul 2024

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc