Security News
JavaScript Leaders Demand Oracle Release the JavaScript Trademark
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
@jest/expect-utils
Advanced tools
@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.
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');
jest-extended provides a large number of additional matchers for Jest. It offers a wide range of matchers similar to @jest/expect-utils, such as toBeArray, toBeObject, and toBeEmpty, but also includes many more specialized matchers.
Chai is an assertion library for Node.js and the browser that can be paired with any testing framework. It provides a rich set of matchers and is highly extensible. While it is not specifically designed for Jest, it offers similar functionalities through its expect/should interfaces.
expect-more is a set of additional matchers for Jest and Jasmine. It provides a variety of matchers for different data types and use cases, similar to @jest/expect-utils, and aims to make tests more expressive and readable.
@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
This module exports some utils for the `expect` function used in [Jest](https://jestjs.io/).
The npm package @jest/expect-utils receives a total of 19,618,313 weekly downloads. As such, @jest/expect-utils popularity was classified as popular.
We found that @jest/expect-utils demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
In an open letter, JavaScript community leaders urge Oracle to give up the JavaScript trademark, arguing that it has been effectively abandoned through nonuse.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.