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

@jest/expect-utils

Package Overview
Dependencies
Maintainers
6
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jest/expect-utils

This module exports some utils for the `expect` function used in [Jest](https://jestjs.io/).

  • 29.0.0-alpha.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21M
increased by5.53%
Maintainers
6
Weekly downloads
 
Created

What is @jest/expect-utils?

@jest/expect-utils is a utility package for Jest that provides additional matchers and utilities to enhance the testing experience. It is designed to work seamlessly with Jest's built-in expect function, allowing for more expressive and readable test assertions.

What are @jest/expect-utils's main functionalities?

toBeArray

Checks if the value is an array.

expect([1, 2, 3]).toBeArray();

toBeObject

Checks if the value is an object.

expect({ key: 'value' }).toBeObject();

toBeEmpty

Checks if the value is empty. This can be used for arrays, objects, or strings.

expect([]).toBeEmpty();

toContainKey

Checks if the object contains the specified key.

expect({ key: 'value' }).toContainKey('key');

toContainValue

Checks if the object contains the specified value.

expect({ key: 'value' }).toContainValue('value');

Other packages similar to @jest/expect-utils

FAQs

Package last updated on 07 Aug 2022

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