
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
jest-array-equal
Advanced tools
A couple straightforward jest array equality matchers.
expect([1, 2, 4]).toEqualArray([2, 4, 1]); // Pass
expect([1, 2, 4, 5]).toEqualArray([2, 4, 1]); // Fail
npm
npm install -D jest-array-equal
Yarn
npm add -D jest-array-equal
In any test file, or the global jest setup file:
import { arrayMatchers } from 'jest-array-equal';
expect.extend(arrayMatchers);
The matcher will be true if the arrays have the exact same contents, regardless of order.
expect([1, 2, 4]).toEqualArray([2, 4, 1]); // Pass
expect([1, 2, 4, 5]).toEqualArray([2, 4, 1]); // Fail
expect([1, 2, 4]).toEqualArray([2, 4, 1, 1]); // Fail
If you want to match arrays of objects by a particular property value:
expect([{ id: 1, id: 2 }]).toEqualArrayBy('id', [{ id: 2, id: 1 }]); // Pass
expect([{ id: 1, id: 2 }]).toEqualArrayBy('id', [{ id: 1, id: 3 }]); // Fail
FAQs
A couple straightforward jest array equality matchers.
The npm package jest-array-equal receives a total of 6 weekly downloads. As such, jest-array-equal popularity was classified as not popular.
We found that jest-array-equal demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.