Curried Type Testing library, and Test Matchers for Jest
Installations
npm install expect-more
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
16.16.0
NPM Version
lerna/6.4.1/node@v16.16.0+x64 (darwin)
Releases
expect-more-jest@5.4.1
Published on 04 Jun 2022
expect-more-jest@5.4.0
Published on 04 Jun 2022
expect-more-jasmine@0.3.0
Published on 08 Aug 2021
expect-more-jest@5.3.0
Published on 08 Aug 2021
expect-more@1.1.0
Published on 08 Aug 2021
1.0.1
Published on 29 Jan 2021
Contributors
Unable to fetch Contributors
Languages
TypeScript (98.66%)
JavaScript (1.31%)
Shell (0.03%)
Developer
JamieMason
Download Statistics
Total Downloads
18,140,378
Last Day
5,119
Last Week
27,362
Last Month
306,319
Last Year
5,320,732
GitHub Statistics
171 Stars
209 Commits
10 Forks
5 Watching
3 Branches
3 Contributors
Package Meta Information
Latest Version
1.3.0
Package Id
expect-more@1.3.0
Unpacked Size
119.08 kB
Size
24.64 kB
File Count
173
NPM Version
lerna/6.4.1/node@v16.16.0+x64 (darwin)
Node Version
16.16.0
Publised On
31 Jan 2023
Total Downloads
Cumulative downloads
Total Downloads
18,140,378
Last day
4.4%
5,119
Compared to previous day
Last week
-54.3%
27,362
Compared to previous week
Last month
-9.1%
306,319
Compared to previous month
Last year
1.3%
5,320,732
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
No dependencies detected.
expect-more
Curried JavaScript Type Testing Library with Zero Dependencies
Installation
npm install expect-more --save-dev
Usage
1import { endsWith, isWithinRange } from 'expect-more'; 2 3const result: boolean = endsWith('Script', 'JavaScript'); 4// => true 5 6const endsWithScript = endsWith('Script'); 7endsWithScript('JavaScript'); 8// => true 9 10isWithinRange(10, 20, 21); 11// => false 12 13[0, 1, 1, 2, 3, 5, 8, 13, 21, 34].filter(isWithinRange(5, 15)); 14// => [5, 8, 13]
API: expect-more
General
1declare const isBoolean: (value: unknown) => value is boolean; 2declare const isFalse: (value: unknown) => value is false; 3declare const isNull: (value: unknown) => value is null; 4declare const isRegExp: (value: unknown) => value is RegExp; 5declare const isTrue: (value: unknown) => value is true; 6declare const isUndefined: (value: unknown) => value is undefined;
Functions
1declare const isAsyncFunction: <T = (...args: any[]) => Promise<any>>( 2 value: unknown, 3) => value is T; 4declare const isFunction: <T = (...args: any[]) => any>(value: unknown) => value is T; 5declare const isGeneratorFunction: <T = Generator>(value: unknown) => value is T; 6declare const throwsAnyError: <T = (...args: any[]) => any>(value: unknown) => value is T; 7declare const throwsErrorOfType: <T = (...args: any[]) => any>( 8 typeName: string, 9 value: unknown, 10) => value is T;
Objects
1declare const hasMember: <T = any>(memberName: string, value: unknown) => value is T; 2declare const isEmptyObject: <T = any>(value: unknown) => value is T; 3declare const isNil: (value: unknown) => value is undefined | null; 4declare const isNonEmptyObject: <T = any>(value: unknown) => value is T; 5declare const isObject: <T = any>(value: unknown) => value is T; 6declare const isWalkable: <T = any>(value: unknown) => value is T;
Arrays
1declare const isArray: <T extends any[] = any[]>(value: unknown) => value is T; 2declare const isArrayIncludingAllOf: <T extends any[] = any[]>(needed: any[], value: unknown) => value is T; 3declare const isArrayIncludingAnyOf: <T extends any[] = any[]>(needed: any[], value: unknown) => value is T; 4declare const isArrayIncludingOnly: <T extends any[] = any[]>(needed: any[], value: unknown) => value is T; 5declare const isArrayOfBooleans: (value: unknown) => value is boolean[]; 6declare const isArrayOfNumbers: (value: unknown) => value is number[]; 7declare const isArrayOfObjects: <T extends any[] = any[]>(value: unknown) => value is T; 8declare const isArrayOfSize: <T extends any[] = any[]>( 9 size: number, 10 value: unknown, 11) => value is T; 12declare const isArrayOfStrings: (value: unknown) => value is string[]; 13declare const isEmptyArray: <T extends [] = []>(any) => value is T; 14declare const isNonEmptyArray: <T extends any[] = any[]>(value: unknown) => value is T;
Dates
1declare const isAfter: (other: Date, value: unknown) => value is Date; 2declare const isBefore: (other: Date, value: unknown) => value is Date; 3declare const isDate: (value: unknown) => value is Date; 4declare const isDateBetween: (floor: Date, ceiling: Date, value: unknown) => value is Date; 5declare const isDateInMonth: (index: number, value: unknown) => value is Date; 6declare const isDateInYear: (year: number, value: unknown) => value is Date; 7declare const isDateOnDayOfMonth: (day: number, value: unknown) => value is Date; 8declare const isDateOnDayOfWeek: (index: number, value: unknown) => value is Date; 9declare const isDateOnOrAfter: (other: Date, value: unknown) => value is Date; 10declare const isDateOnOrBefore: (other: Date, value: unknown) => value is Date; 11declare const isValidDate: (value: unknown) => value is Date;
Numbers
1declare const isCalculable: (value: unknown) => value is number; 2declare const isDecimalNumber: (value: unknown) => value is number; 3declare const isDivisibleBy: (other: number, value: unknown) => value is number; 4declare const isEvenNumber: (value: unknown) => value is number; 5declare const isGreaterThanOrEqualTo: (other: number, value: unknown) => value is number; 6declare const isLessThanOrEqualTo: (other: number, value: unknown) => value is number; 7declare const isNear: (other: number, epsilon: number, value: unknown) => value is number; 8declare const isNegativeNumber: (value: unknown) => value is number; 9declare const isNumber: (value: unknown) => value is number; 10declare const isOddNumber: (value: unknown) => value is number; 11declare const isPositiveNumber: (value: unknown) => value is number; 12declare const isWholeNumber: (value: unknown) => value is number; 13declare const isWithinRange: ( 14 floor: number, 15 ceiling: number, 16 value: unknown, 17) => value is number;
Strings
1declare const endsWith: (other: string, value: unknown) => value is string; 2declare const isEmptyString: (value: unknown) => value is string; 3declare const isIso8601: (value: unknown) => value is string; 4declare const isJsonString: (value: unknown) => value is string; 5declare const isLongerThan: (other: string, value: unknown) => value is string; 6declare const isNonEmptyString: (value: unknown) => value is string; 7declare const isSameLengthAs: (other: string, value: unknown) => value is string; 8declare const isShorterThan: (other: string, value: unknown) => value is string; 9declare const isString: (value: unknown) => value is string; 10declare const isVisibleString: (value: unknown) => value is string; 11declare const isWhitespace: (value: unknown) => value is string; 12declare const startsWith: (other: string, value: unknown) => value is string;
API: expect-more/gen
1declare const withMissingBranches: (value: object | any[]) => Generator; 2declare const withMissingLeaves: (value: object | any[]) => Generator; 3declare const withMissingNodes: (value: object | any[]) => Generator; 4declare const withNullBranches: (value: object | any[]) => Generator; 5declare const withNullLeaves: (value: object | any[]) => Generator; 6declare const withNullNodes: (value: object | any[]) => Generator;
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
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
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 7 are checked with a SAST tool
Reason
14 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Score
1.7
/10
Last Scanned on 2025-01-13
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