jest-extended
Advanced tools
Comparing version 0.8.1 to 0.9.0
@@ -61,154 +61,158 @@ 'use strict'; | ||
var _index14 = require('./toBeNaN/index.js'); | ||
var _index14 = require('./toBeHexadecimal/index.js'); | ||
var _toBeNaNIndexJs = _interopRequireWildcard(_index14); | ||
var _toBeHexadecimalIndexJs = _interopRequireWildcard(_index14); | ||
var _index15 = require('./toBeNegative/index.js'); | ||
var _index15 = require('./toBeNaN/index.js'); | ||
var _toBeNegativeIndexJs = _interopRequireWildcard(_index15); | ||
var _toBeNaNIndexJs = _interopRequireWildcard(_index15); | ||
var _index16 = require('./toBeNil/index.js'); | ||
var _index16 = require('./toBeNegative/index.js'); | ||
var _toBeNilIndexJs = _interopRequireWildcard(_index16); | ||
var _toBeNegativeIndexJs = _interopRequireWildcard(_index16); | ||
var _index17 = require('./toBeNumber/index.js'); | ||
var _index17 = require('./toBeNil/index.js'); | ||
var _toBeNumberIndexJs = _interopRequireWildcard(_index17); | ||
var _toBeNilIndexJs = _interopRequireWildcard(_index17); | ||
var _index18 = require('./toBeObject/index.js'); | ||
var _index18 = require('./toBeNumber/index.js'); | ||
var _toBeObjectIndexJs = _interopRequireWildcard(_index18); | ||
var _toBeNumberIndexJs = _interopRequireWildcard(_index18); | ||
var _index19 = require('./toBeOdd/index.js'); | ||
var _index19 = require('./toBeObject/index.js'); | ||
var _toBeOddIndexJs = _interopRequireWildcard(_index19); | ||
var _toBeObjectIndexJs = _interopRequireWildcard(_index19); | ||
var _index20 = require('./toBeOneOf/index.js'); | ||
var _index20 = require('./toBeOdd/index.js'); | ||
var _toBeOneOfIndexJs = _interopRequireWildcard(_index20); | ||
var _toBeOddIndexJs = _interopRequireWildcard(_index20); | ||
var _index21 = require('./toBePositive/index.js'); | ||
var _index21 = require('./toBeOneOf/index.js'); | ||
var _toBePositiveIndexJs = _interopRequireWildcard(_index21); | ||
var _toBeOneOfIndexJs = _interopRequireWildcard(_index21); | ||
var _index22 = require('./toBeSealed/index.js'); | ||
var _index22 = require('./toBePositive/index.js'); | ||
var _toBeSealedIndexJs = _interopRequireWildcard(_index22); | ||
var _toBePositiveIndexJs = _interopRequireWildcard(_index22); | ||
var _index23 = require('./toBeString/index.js'); | ||
var _index23 = require('./toBeSealed/index.js'); | ||
var _toBeStringIndexJs = _interopRequireWildcard(_index23); | ||
var _toBeSealedIndexJs = _interopRequireWildcard(_index23); | ||
var _index24 = require('./toBeTrue/index.js'); | ||
var _index24 = require('./toBeString/index.js'); | ||
var _toBeTrueIndexJs = _interopRequireWildcard(_index24); | ||
var _toBeStringIndexJs = _interopRequireWildcard(_index24); | ||
var _index25 = require('./toBeValidDate/index.js'); | ||
var _index25 = require('./toBeTrue/index.js'); | ||
var _toBeValidDateIndexJs = _interopRequireWildcard(_index25); | ||
var _toBeTrueIndexJs = _interopRequireWildcard(_index25); | ||
var _index26 = require('./toBeWithin/index.js'); | ||
var _index26 = require('./toBeValidDate/index.js'); | ||
var _toBeWithinIndexJs = _interopRequireWildcard(_index26); | ||
var _toBeValidDateIndexJs = _interopRequireWildcard(_index26); | ||
var _index27 = require('./toContainAllEntries/index.js'); | ||
var _index27 = require('./toBeWithin/index.js'); | ||
var _toContainAllEntriesIndexJs = _interopRequireWildcard(_index27); | ||
var _toBeWithinIndexJs = _interopRequireWildcard(_index27); | ||
var _index28 = require('./toContainAllKeys/index.js'); | ||
var _index28 = require('./toContainAllEntries/index.js'); | ||
var _toContainAllKeysIndexJs = _interopRequireWildcard(_index28); | ||
var _toContainAllEntriesIndexJs = _interopRequireWildcard(_index28); | ||
var _index29 = require('./toContainAllValues/index.js'); | ||
var _index29 = require('./toContainAllKeys/index.js'); | ||
var _toContainAllValuesIndexJs = _interopRequireWildcard(_index29); | ||
var _toContainAllKeysIndexJs = _interopRequireWildcard(_index29); | ||
var _index30 = require('./toContainAnyEntries/index.js'); | ||
var _index30 = require('./toContainAllValues/index.js'); | ||
var _toContainAnyEntriesIndexJs = _interopRequireWildcard(_index30); | ||
var _toContainAllValuesIndexJs = _interopRequireWildcard(_index30); | ||
var _index31 = require('./toContainAnyKeys/index.js'); | ||
var _index31 = require('./toContainAnyEntries/index.js'); | ||
var _toContainAnyKeysIndexJs = _interopRequireWildcard(_index31); | ||
var _toContainAnyEntriesIndexJs = _interopRequireWildcard(_index31); | ||
var _index32 = require('./toContainAnyValues/index.js'); | ||
var _index32 = require('./toContainAnyKeys/index.js'); | ||
var _toContainAnyValuesIndexJs = _interopRequireWildcard(_index32); | ||
var _toContainAnyKeysIndexJs = _interopRequireWildcard(_index32); | ||
var _index33 = require('./toContainEntries/index.js'); | ||
var _index33 = require('./toContainAnyValues/index.js'); | ||
var _toContainEntriesIndexJs = _interopRequireWildcard(_index33); | ||
var _toContainAnyValuesIndexJs = _interopRequireWildcard(_index33); | ||
var _index34 = require('./toContainEntry/index.js'); | ||
var _index34 = require('./toContainEntries/index.js'); | ||
var _toContainEntryIndexJs = _interopRequireWildcard(_index34); | ||
var _toContainEntriesIndexJs = _interopRequireWildcard(_index34); | ||
var _index35 = require('./toContainKey/index.js'); | ||
var _index35 = require('./toContainEntry/index.js'); | ||
var _toContainKeyIndexJs = _interopRequireWildcard(_index35); | ||
var _toContainEntryIndexJs = _interopRequireWildcard(_index35); | ||
var _index36 = require('./toContainKeys/index.js'); | ||
var _index36 = require('./toContainKey/index.js'); | ||
var _toContainKeysIndexJs = _interopRequireWildcard(_index36); | ||
var _toContainKeyIndexJs = _interopRequireWildcard(_index36); | ||
var _index37 = require('./toContainValue/index.js'); | ||
var _index37 = require('./toContainKeys/index.js'); | ||
var _toContainValueIndexJs = _interopRequireWildcard(_index37); | ||
var _toContainKeysIndexJs = _interopRequireWildcard(_index37); | ||
var _index38 = require('./toContainValues/index.js'); | ||
var _index38 = require('./toContainValue/index.js'); | ||
var _toContainValuesIndexJs = _interopRequireWildcard(_index38); | ||
var _toContainValueIndexJs = _interopRequireWildcard(_index38); | ||
var _index39 = require('./toEndWith/index.js'); | ||
var _index39 = require('./toContainValues/index.js'); | ||
var _toEndWithIndexJs = _interopRequireWildcard(_index39); | ||
var _toContainValuesIndexJs = _interopRequireWildcard(_index39); | ||
var _index40 = require('./toEqualCaseInsensitive/index.js'); | ||
var _index40 = require('./toEndWith/index.js'); | ||
var _toEqualCaseInsensitiveIndexJs = _interopRequireWildcard(_index40); | ||
var _toEndWithIndexJs = _interopRequireWildcard(_index40); | ||
var _index41 = require('./toHaveBeenCalledAfter/index.js'); | ||
var _index41 = require('./toEqualCaseInsensitive/index.js'); | ||
var _toHaveBeenCalledAfterIndexJs = _interopRequireWildcard(_index41); | ||
var _toEqualCaseInsensitiveIndexJs = _interopRequireWildcard(_index41); | ||
var _index42 = require('./toHaveBeenCalledBefore/index.js'); | ||
var _index42 = require('./toHaveBeenCalledAfter/index.js'); | ||
var _toHaveBeenCalledBeforeIndexJs = _interopRequireWildcard(_index42); | ||
var _toHaveBeenCalledAfterIndexJs = _interopRequireWildcard(_index42); | ||
var _index43 = require('./toInclude/index.js'); | ||
var _index43 = require('./toHaveBeenCalledBefore/index.js'); | ||
var _toIncludeIndexJs = _interopRequireWildcard(_index43); | ||
var _toHaveBeenCalledBeforeIndexJs = _interopRequireWildcard(_index43); | ||
var _index44 = require('./toIncludeAllMembers/index.js'); | ||
var _index44 = require('./toInclude/index.js'); | ||
var _toIncludeAllMembersIndexJs = _interopRequireWildcard(_index44); | ||
var _toIncludeIndexJs = _interopRequireWildcard(_index44); | ||
var _index45 = require('./toIncludeAnyMembers/index.js'); | ||
var _index45 = require('./toIncludeAllMembers/index.js'); | ||
var _toIncludeAnyMembersIndexJs = _interopRequireWildcard(_index45); | ||
var _toIncludeAllMembersIndexJs = _interopRequireWildcard(_index45); | ||
var _index46 = require('./toIncludeMultiple/index.js'); | ||
var _index46 = require('./toIncludeAnyMembers/index.js'); | ||
var _toIncludeMultipleIndexJs = _interopRequireWildcard(_index46); | ||
var _toIncludeAnyMembersIndexJs = _interopRequireWildcard(_index46); | ||
var _index47 = require('./toIncludeRepeated/index.js'); | ||
var _index47 = require('./toIncludeMultiple/index.js'); | ||
var _toIncludeRepeatedIndexJs = _interopRequireWildcard(_index47); | ||
var _toIncludeMultipleIndexJs = _interopRequireWildcard(_index47); | ||
var _index48 = require('./toIncludeSameMembers/index.js'); | ||
var _index48 = require('./toIncludeRepeated/index.js'); | ||
var _toIncludeSameMembersIndexJs = _interopRequireWildcard(_index48); | ||
var _toIncludeRepeatedIndexJs = _interopRequireWildcard(_index48); | ||
var _index49 = require('./toSatisfy/index.js'); | ||
var _index49 = require('./toIncludeSameMembers/index.js'); | ||
var _toSatisfyIndexJs = _interopRequireWildcard(_index49); | ||
var _toIncludeSameMembersIndexJs = _interopRequireWildcard(_index49); | ||
var _index50 = require('./toSatisfyAll/index.js'); | ||
var _index50 = require('./toSatisfy/index.js'); | ||
var _toSatisfyAllIndexJs = _interopRequireWildcard(_index50); | ||
var _toSatisfyIndexJs = _interopRequireWildcard(_index50); | ||
var _index51 = require('./toStartWith/index.js'); | ||
var _index51 = require('./toSatisfyAll/index.js'); | ||
var _toStartWithIndexJs = _interopRequireWildcard(_index51); | ||
var _toSatisfyAllIndexJs = _interopRequireWildcard(_index51); | ||
var _index52 = require('./toStartWith/index.js'); | ||
var _toStartWithIndexJs = _interopRequireWildcard(_index52); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } | ||
@@ -230,2 +234,3 @@ | ||
'./toBeFunction/index.js': _toBeFunctionIndexJs, | ||
'./toBeHexadecimal/index.js': _toBeHexadecimalIndexJs, | ||
'./toBeNaN/index.js': _toBeNaNIndexJs, | ||
@@ -232,0 +237,0 @@ './toBeNegative/index.js': _toBeNegativeIndexJs, |
{ | ||
"name": "jest-extended", | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"description": "Additional Jest matchers", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -98,2 +98,3 @@ <div align="center"> | ||
- [.toBeString()](#tobestring) | ||
- [.toBeHexadecimal(string)](#tobehexadecimal) | ||
- [.toEqualCaseInsensitive(string)](#toequalcaseinsensitivestring) | ||
@@ -774,2 +775,15 @@ - [.toStartWith(prefix)](#tostartwithprefix) | ||
#### .toBeHexadecimal(string) | ||
Use `.toBeHexadecimal` when checking if a value is a valid HTML hexadecimal color. | ||
```js | ||
test('passes when value is a valid hexadecimal', () => { | ||
expect('#abc123').toBeHexadecimal(); | ||
expect('#FFF').toBeHexadecimal(); | ||
expect('#000000').toBeHexadecimal(); | ||
expect('#123ffg').not.toBeHexadecimal(); | ||
}); | ||
``` | ||
#### .toEqualCaseInsensitive(string) | ||
@@ -839,4 +853,4 @@ | ||
test('passes when value includes all substrings', () => { | ||
expect('hello world').toInclude(['world', 'hello']); | ||
expect('hello world').not.toInclude(['world', 'hello', 'bob']); | ||
expect('hello world').toIncludeMultiple(['world', 'hello']); | ||
expect('hello world').not.toIncludeMultiple(['world', 'hello', 'bob']); | ||
}); | ||
@@ -854,3 +868,3 @@ ``` | ||
| [<img src="https://avatars1.githubusercontent.com/u/1404810?v=4" width="100px;"/><br /><sub>Simen Bekkhus</sub>](https://github.com/SimenB)<br />[π](https://github.com/mattphillips/jest-extended/commits?author=SimenB "Documentation") | [<img src="https://avatars2.githubusercontent.com/u/49038?v=4" width="100px;"/><br /><sub>Orta</sub>](http://orta.io)<br />[π](https://github.com/mattphillips/jest-extended/commits?author=orta "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/17221813?v=4" width="100px;"/><br /><sub>Tom</sub>](https://jsdevtom.com)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=jsdevtom "Code") [π](https://github.com/mattphillips/jest-extended/commits?author=jsdevtom "Documentation") [π‘](#example-jsdevtom "Examples") [β οΈ](https://github.com/mattphillips/jest-extended/commits?author=jsdevtom "Tests") | [<img src="https://avatars0.githubusercontent.com/u/15064535?v=4" width="100px;"/><br /><sub>Lucian Buzzo</sub>](https://github.com/LucianBuzzo)<br /> | [<img src="https://avatars3.githubusercontent.com/u/2997844?v=4" width="100px;"/><br /><sub>Thiago Delgado Pinto</sub>](https://github.com/thiagodp)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=thiagodp "Code") [π](https://github.com/mattphillips/jest-extended/commits?author=thiagodp "Documentation") [π‘](#example-thiagodp "Examples") [π€](#ideas-thiagodp "Ideas, Planning, & Feedback") [β οΈ](https://github.com/mattphillips/jest-extended/commits?author=thiagodp "Tests") | [<img src="https://avatars0.githubusercontent.com/u/3042904?v=4" width="100px;"/><br /><sub>Ragnar Laud</sub>](https://github.com/xprn)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=xprn "Code") [π](https://github.com/mattphillips/jest-extended/commits?author=xprn "Documentation") | [<img src="https://avatars0.githubusercontent.com/u/3047126?v=4" width="100px;"/><br /><sub>Luiz AmΓ©rico</sub>](https://github.com/blikblum)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=blikblum "Code") | | ||
| [<img src="https://avatars0.githubusercontent.com/u/615334?v=4" width="100px;"/><br /><sub>Frederick Fogerty</sub>](https://github.com/frederickfogerty)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=frederickfogerty "Code") [π€](#ideas-frederickfogerty "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/10714808?v=4" width="100px;"/><br /><sub>Benjamin Kay</sub>](https://github.com/benjaminkay93)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=benjaminkay93 "Code") [π](https://github.com/mattphillips/jest-extended/commits?author=benjaminkay93 "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/868844?v=4" width="100px;"/><br /><sub>Gilles De Mey</sub>](https://demey.io)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=gillesdemey "Code") [π](https://github.com/mattphillips/jest-extended/commits?author=gillesdemey "Documentation") [β οΈ](https://github.com/mattphillips/jest-extended/commits?author=gillesdemey "Tests") | [<img src="https://avatars0.githubusercontent.com/u/50928?v=4" width="100px;"/><br /><sub>Deniz Dogan</sub>](https://github.com/denizdogan)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=denizdogan "Code") | | ||
| [<img src="https://avatars0.githubusercontent.com/u/615334?v=4" width="100px;"/><br /><sub>Frederick Fogerty</sub>](https://github.com/frederickfogerty)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=frederickfogerty "Code") [π€](#ideas-frederickfogerty "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/10714808?v=4" width="100px;"/><br /><sub>Benjamin Kay</sub>](https://github.com/benjaminkay93)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=benjaminkay93 "Code") [π](https://github.com/mattphillips/jest-extended/commits?author=benjaminkay93 "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/868844?v=4" width="100px;"/><br /><sub>Gilles De Mey</sub>](https://demey.io)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=gillesdemey "Code") [π](https://github.com/mattphillips/jest-extended/commits?author=gillesdemey "Documentation") [β οΈ](https://github.com/mattphillips/jest-extended/commits?author=gillesdemey "Tests") | [<img src="https://avatars0.githubusercontent.com/u/50928?v=4" width="100px;"/><br /><sub>Deniz Dogan</sub>](https://github.com/denizdogan)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=denizdogan "Code") | [<img src="https://avatars1.githubusercontent.com/u/13043635?v=4" width="100px;"/><br /><sub>Mikey Powers</sub>](https://github.com/mvpowers)<br />[π»](https://github.com/mattphillips/jest-extended/commits?author=mvpowers "Code") [π](https://github.com/mattphillips/jest-extended/commits?author=mvpowers "Documentation") [β οΈ](https://github.com/mattphillips/jest-extended/commits?author=mvpowers "Tests") | | ||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
@@ -857,0 +871,0 @@ |
@@ -42,3 +42,3 @@ /// <reference types="jest" /> | ||
*/ | ||
toSatisfy(predicate: () => boolean): R; | ||
toSatisfy(predicate: (x: any) => boolean): R; | ||
@@ -90,3 +90,3 @@ /** | ||
*/ | ||
toSatisfyAll(predicate: () => boolean): R; | ||
toSatisfyAll(predicate: (x: any) => boolean): R; | ||
@@ -124,2 +124,9 @@ /** | ||
/** | ||
* Use `.toBeHexadecimal` when checking if a value is a valid HTML hex color. | ||
* | ||
* @param {String} string | ||
*/ | ||
toBeHexadecimal(string: string): R; | ||
/** | ||
* Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`. | ||
@@ -126,0 +133,0 @@ * |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
132319
110
1786
871