Socket
Socket
Sign inDemoInstall

@testing-library/jest-native

Package Overview
Dependencies
Maintainers
15
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testing-library/jest-native

Custom jest matchers to test the state of React Native


Version published
Weekly downloads
410K
increased by4.23%
Maintainers
15
Weekly downloads
 
Created

What is @testing-library/jest-native?

@testing-library/jest-native is a set of custom jest matchers to test the state of React Native components. It extends jest-dom to provide more specific matchers for React Native components, making it easier to write tests that are more readable and maintainable.

What are @testing-library/jest-native's main functionalities?

toHaveTextContent

This matcher checks if a React Native component contains the specified text content. It is useful for verifying that text elements render the correct content.

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

toBeDisabled

This matcher checks if a button or other interactive element is disabled. It helps ensure that the UI behaves correctly based on the component's state.

expect(button).toBeDisabled()

toHaveStyle

This matcher checks if a component has the specified style properties. It is useful for verifying that styles are applied correctly to components.

expect(element).toHaveStyle({ color: 'red' })

toBeVisible

This matcher checks if a component is visible in the UI. It helps ensure that elements are rendered and visible to the user as expected.

expect(element).toBeVisible()

Other packages similar to @testing-library/jest-native

Keywords

FAQs

Package last updated on 22 Aug 2023

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