Gathering detailed insights and metrics for @alex_neo/jest-expect-message
Gathering detailed insights and metrics for @alex_neo/jest-expect-message
Gathering detailed insights and metrics for @alex_neo/jest-expect-message
Gathering detailed insights and metrics for @alex_neo/jest-expect-message
npm install @alex_neo/jest-expect-message
Typescript
Module System
Node Version
NPM Version
98.1
Supply Chain
100
Quality
75.3
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
368 Stars
45 Commits
41 Forks
7 Watchers
3 Branches
7 Contributors
Updated on Jun 25, 2025
Latest Version
1.0.5
Package Id
@alex_neo/jest-expect-message@1.0.5
Unpacked Size
24.44 kB
Size
7.92 kB
File Count
19
NPM Version
6.14.11
Node Version
14.16.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
🃏🗯
Add custom message to Jest expects
In many testing libraries it is possible to supply a custom message for a given expectation, this is currently not possible in Jest.
For example:
1test('returns 2 when adding 1 and 1', () => { 2 expect(1 + 1, 'Woah this should be 2!').toBe(3); 3});
This will throw the following error in Jest:
1Expect takes at most one argument.
jest-expect-message
allows you to call expect
with a second argument of a String
message.
For example the same test as above:
1test('returns 2 when adding 1 and 1', () => { 2 expect(1 + 1, 'Woah this should be 2!').toBe(3); 3});
With jest-expect-message
this will fail with your custom error message:
1 ● returns 2 when adding 1 and 1 2 3 Custom message: 4 Woah this should be 2! 5 6 expect(received).toBe(expected) // Object.is equality 7 8 Expected: 3 9 Received: 2
With npm:
1npm install --save-dev jest-expect-message
With yarn:
1yarn add -D jest-expect-message
Add jest-expect-message
to your Jest setupFilesAfterEnv
configuration.
See for help
1"jest": { 2 "setupFilesAfterEnv": ["jest-expect-message"] 3}
1"jest": { 2 "setupTestFrameworkScriptFile": "jest-expect-message" 3}
expect(actual, message)
actual
: The value you would normally pass into an expect
to assert against with a given matcher.message
: String, the custom message you want to be printed should the expect
fail.1test('returns 2 when adding 1 and 1', () => { 2 expect(1 + 1, 'Woah this should be 2!').toBe(3); 3});
Matt Phillips 💻 📖 💡 🤔 🚇 ⚠️ 🔧 | Alex Neo 💻 |
---|
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
Found 6/29 approved changesets -- score normalized to 2
Reason
8 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More