Gathering detailed insights and metrics for expect-more-jest
Gathering detailed insights and metrics for expect-more-jest
Gathering detailed insights and metrics for expect-more-jest
Gathering detailed insights and metrics for expect-more-jest
expect-even-more-jest
expect-more-jest with even more stuff
jest-expect
Make jest expect more convenient.
expect-more-jasmine
Write Beautiful Specs with Custom Matchers for Jasmine
rocket-tester
- [jest-extended](https://github.com/jest-community/jest-extended) - [expect-more](https://github.com/JamieMason/expect-more/) - [jest-generator](https://github.com/doniyor2109/jest-generator)
Curried Type Testing library, and Test Matchers for Jest
npm install expect-more-jest
Typescript
Module System
Node Version
NPM Version
97.3
Supply Chain
99
Quality
76
Maintenance
100
Vulnerability
99.6
License
expect-more-jest@5.4.1
Updated on Jun 04, 2022
expect-more-jest@5.4.0
Updated on Jun 04, 2022
expect-more-jasmine@0.3.0
Updated on Aug 08, 2021
expect-more-jest@5.3.0
Updated on Aug 08, 2021
expect-more@1.1.0
Updated on Aug 08, 2021
1.0.1
Updated on Jan 29, 2021
TypeScript (98.66%)
JavaScript (1.31%)
Shell (0.03%)
Total Downloads
4,726,535
Last Day
1,163
Last Week
28,582
Last Month
126,088
Last Year
1,441,353
MIT License
173 Stars
209 Commits
9 Forks
4 Watchers
3 Branches
3 Contributors
Updated on Jun 02, 2025
Minified
Minified + Gzipped
Latest Version
5.5.0
Package Id
expect-more-jest@5.5.0
Unpacked Size
129.04 kB
Size
17.04 kB
File Count
125
NPM Version
lerna/6.4.1/node@v16.16.0+x64 (darwin)
Node Version
16.16.0
Published on
Jan 31, 2023
Cumulative downloads
Total Downloads
Last Day
36.3%
1,163
Compared to previous day
Last Week
-3.6%
28,582
Compared to previous week
Last Month
2.5%
126,088
Compared to previous month
Last Year
24.3%
1,441,353
Compared to previous year
3
Write Beautiful Specs with Custom Matchers for Jest
expect-more-jest is a huge library of test matchers for a range of common use-cases, to make tests easier to read and produce relevant and useful messages when they fail.
Avoid vague messages such as "expected false to be true" in favour of useful cues like "expected
3 to be even number", and avoid implementation noise such as
expect(paws.length % 2 === 0).toEqual(true)
in favour of simply stating that you
expect(paws.length).toBeEvenNumber()
.
npm install expect-more-jest --save-dev
Include one of the following at the top of your test file.
1import 'expect-more-jest'; 2// or 3require('expect-more-jest');
1describe('expect-more-jest', () => { 2 it('makes your tests and output easier to read', () => { 3 expect(new Date('2020-01-01')).toBeAfter(new Date('2019-12-31')); 4 expect([12, 0, 14, 'Ivo']).toBeArrayIncludingAllOf(['Ivo', 14]); 5 expect([12, 0, 14, 'Ginola']).toBeArrayIncludingAnyOf(['Ginola', 3]); 6 expect([5, 10, 1]).toBeArrayIncludingOnly([1, 5, 10]); 7 expect([true, false, new Boolean(true)]).toBeArrayOfBooleans(); 8 expect([12, 0, 14]).toBeArrayOfNumbers(); 9 expect([{}, new Object()]).toBeArrayOfObjects(); 10 expect(['i', 'contain', 4, 'items']).toBeArrayOfSize(4); 11 expect(['we', 'are', 'all', 'strings']).toBeArrayOfStrings(); 12 expect([{ name: 'Guybrush' }, { name: 'Elaine' }]).toBeArrayOf({ 13 name: expect.toBeNonEmptyString(), 14 }); 15 expect([2, true, 'string']).toBeArray(); 16 expect(async () => { 17 await fetch('...'); 18 }).toBeAsyncFunction(); 19 expect(new Date('2019-12-31')).toBeBefore(new Date('2020-01-01')); 20 expect(false).toBeBoolean(); 21 expect('100').toBeCalculable(); 22 expect(new Date('2019-12-11')).toBeDateBetween(new Date('2019-12-10'), new Date('2019-12-12')); 23 expect(new Date('2021-08-29')).toBeDateInMonth(7); 24 expect(new Date('2021-08-29')).toBeDateInYear(2021); 25 expect(new Date('2021-08-29')).toBeDateOnDayOfMonth(29); 26 expect(new Date('2021-08-29')).toBeDateOnDayOfWeek(0); 27 expect(new Date('2019-12-31')).toBeDateOnOrAfter(new Date('2019-12-15')); 28 expect(new Date('2019-12-15')).toBeDateOnOrBefore(new Date('2019-12-31')); 29 expect(new Date('2019-12-31')).toBeDate(); 30 expect(12.55).toBeDecimalNumber(); 31 expect(12).toBeDivisibleBy(2); 32 expect([]).toBeEmptyArray(); 33 expect({}).toBeEmptyObject(); 34 expect('').toBeEmptyString(); 35 expect(2).toBeEvenNumber(); 36 expect(false).toBeFalse(); 37 expect(() => 'i am a function').toBeFunction(); 38 expect(function* gen() { 39 yield 'i am a generator'; 40 }).toBeGeneratorFunction(); 41 expect('1999-12-31T23:59:59').toBeIso8601(); 42 expect('{"i":"am valid JSON"}').toBeJsonString(); 43 expect(['i', 'have', 3]).toBeLongerThan([2, 'items']); 44 expect(-18).toBeNegativeNumber(); 45 expect(undefined).toBeNil(); 46 expect(['i', 'am not empty']).toBeNonEmptyArray(); 47 expect({ i: 'am not empty' }).toBeNonEmptyObject(); 48 expect('i am not empty').toBeNonEmptyString(); 49 expect({ x: 12, y: 22 }).toBeNullableOf({ 50 x: expect.toBeNumber(), 51 y: expect.toBeNumber(), 52 }); 53 expect(null).toBeNullableOf({ 54 x: expect.toBeNumber(), 55 y: expect.toBeNumber(), 56 }); 57 expect(8).toBeNumber(); 58 expect({}).toBeObject(); 59 expect(5).toBeOddNumber(); 60 expect({ x: 12, y: 22 }).toBeOptionalOf({ 61 x: expect.toBeNumber(), 62 y: expect.toBeNumber(), 63 }); 64 expect(undefined).toBeOptionalOf({ 65 x: expect.toBeNumber(), 66 y: expect.toBeNumber(), 67 }); 68 expect(5).toBePositiveNumber(); 69 expect(new RegExp('i am a regular expression')).toBeRegExp(); 70 expect(['i also have', '2 items']).toBeSameLengthAs(['i have', '2 items']); 71 expect(['i have one item']).toBeShorterThan(['i', 'have', 4, 'items']); 72 expect('i am a string').toBeString(); 73 expect(true).toBeTrue(); 74 expect(new Date('2020-01-01')).toBeValidDate(); 75 expect('i am visible').toBeVisibleString(); 76 expect({}).toBeWalkable(); 77 expect(' ').toBeWhitespace(); 78 expect(8).toBeWholeNumber(); 79 expect(7).toBeWithinRange(0, 10); 80 expect('JavaScript').toEndWith('Script'); 81 expect('JavaScript').toStartWith('Java'); 82 }); 83});
Get help with issues by creating a Bug Report or discuss ideas by opening a Feature Request.
If you find my Open Source projects useful, please share them ❤️
I'm Jamie Mason from Leeds in England, I began Web Design and Development in 1999 and have been Contracting and offering Consultancy as Fold Left Ltd since 2012. Who I've worked with includes Sky Sports, Sky Bet, Sky Poker, The Premier League, William Hill, Shell, Betfair, and Football Clubs including Leeds United, Spurs, West Ham, Arsenal, and more.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/23 approved changesets -- score normalized to 0
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
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
Reason
20 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
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