expect
Advanced tools
Comparing version 28.0.0-alpha.8 to 28.0.0-alpha.9
@@ -27,2 +27,4 @@ 'use strict'; | ||
var _jestUtil = require('jest-util'); | ||
var _jestMatchersObject = require('./jestMatchersObject'); | ||
@@ -389,2 +391,10 @@ | ||
} | ||
toAsymmetricMatcher() { | ||
return [ | ||
this.toString(), | ||
this.sample, | ||
`(${(0, _jestUtil.pluralize)('digit', this.precision)})` | ||
].join(' '); | ||
} | ||
} | ||
@@ -391,0 +401,0 @@ |
@@ -11,3 +11,17 @@ /** | ||
declare type AsymmetricMatcher = { | ||
export declare abstract class AsymmetricMatcher<T> | ||
implements AsymmetricMatcher_2 | ||
{ | ||
protected sample: T; | ||
protected inverse: boolean; | ||
$$typeof: symbol; | ||
constructor(sample: T, inverse?: boolean); | ||
protected getMatcherContext(): MatcherState; | ||
abstract asymmetricMatch(other: unknown): boolean; | ||
abstract toString(): string; | ||
getExpectedType?(): string; | ||
toAsymmetricMatcher?(): string; | ||
} | ||
declare type AsymmetricMatcher_2 = { | ||
asymmetricMatch(other: unknown): boolean; | ||
@@ -20,9 +34,9 @@ toString(): string; | ||
export declare interface AsymmetricMatchers { | ||
any(sample: unknown): AsymmetricMatcher; | ||
anything(): AsymmetricMatcher; | ||
arrayContaining(sample: Array<unknown>): AsymmetricMatcher; | ||
closeTo(sample: number, precision?: number): AsymmetricMatcher; | ||
objectContaining(sample: Record<string, unknown>): AsymmetricMatcher; | ||
stringContaining(sample: string): AsymmetricMatcher; | ||
stringMatching(sample: string | RegExp): AsymmetricMatcher; | ||
any(sample: unknown): AsymmetricMatcher_2; | ||
anything(): AsymmetricMatcher_2; | ||
arrayContaining(sample: Array<unknown>): AsymmetricMatcher_2; | ||
closeTo(sample: number, precision?: number): AsymmetricMatcher_2; | ||
objectContaining(sample: Record<string, unknown>): AsymmetricMatcher_2; | ||
stringContaining(sample: string): AsymmetricMatcher_2; | ||
stringMatching(sample: string | RegExp): AsymmetricMatcher_2; | ||
} | ||
@@ -29,0 +43,0 @@ |
@@ -6,2 +6,8 @@ 'use strict'; | ||
}); | ||
Object.defineProperty(exports, 'AsymmetricMatcher', { | ||
enumerable: true, | ||
get: function () { | ||
return _asymmetricMatchers.AsymmetricMatcher; | ||
} | ||
}); | ||
exports.expect = exports.default = exports.JestAssertionError = void 0; | ||
@@ -8,0 +14,0 @@ |
{ | ||
"name": "expect", | ||
"version": "28.0.0-alpha.8", | ||
"version": "28.0.0-alpha.9", | ||
"repository": { | ||
@@ -21,9 +21,9 @@ "type": "git", | ||
"dependencies": { | ||
"@jest/expect-utils": "^28.0.0-alpha.8", | ||
"@jest/expect-utils": "^28.0.0-alpha.9", | ||
"jest-get-type": "^28.0.0-alpha.3", | ||
"jest-matcher-utils": "^28.0.0-alpha.8", | ||
"jest-message-util": "^28.0.0-alpha.8" | ||
"jest-matcher-utils": "^28.0.0-alpha.9", | ||
"jest-message-util": "^28.0.0-alpha.9" | ||
}, | ||
"devDependencies": { | ||
"@jest/test-utils": "^28.0.0-alpha.8", | ||
"@jest/test-utils": "^28.0.0-alpha.9", | ||
"@tsd/typescript": "~4.6.2", | ||
@@ -41,3 +41,3 @@ "chalk": "^4.0.0", | ||
}, | ||
"gitHead": "d915e7df92b220dbe6e124585ba6459838a6c41c" | ||
"gitHead": "7c63f5981eb20d4b89a4c04f3675e0050d8d7887" | ||
} |
142746
4298