You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@jest/expect-utils

Package Overview
Dependencies
Maintainers
5
Versions
47
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/).


Version published
Weekly downloads
16M
decreased by-18.85%
Maintainers
5
Created
Weekly downloads
 

Package description

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

Readme

Source

@jest/expect-utils

This module exports some utils for the expect function used in Jest.

You probably don't want to use this package directly. E.g. if you're writing custom matcher, you should use the injected this.equals.

FAQs

Package last updated on 12 May 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