expect
Advanced tools
Comparing version 29.0.0-alpha.4 to 29.0.0-alpha.6
@@ -127,2 +127,4 @@ 'use strict'; | ||
return { | ||
// eslint-disable-next-line @typescript-eslint/no-empty-function | ||
dontThrow: () => {}, | ||
...(0, _jestMatchersObject.getState)(), | ||
@@ -129,0 +131,0 @@ equals: _expectUtils.equals, |
@@ -18,3 +18,3 @@ /** | ||
constructor(sample: T, inverse?: boolean); | ||
protected getMatcherContext(): MatcherState; | ||
protected getMatcherContext(): MatcherContext; | ||
abstract asymmetricMatch(other: unknown): boolean; | ||
@@ -87,9 +87,15 @@ abstract toString(): string; | ||
export declare type MatcherContext = MatcherUtils & Readonly<MatcherState>; | ||
export declare type MatcherFunction<Expected extends Array<unknown> = []> = | ||
MatcherFunctionWithState<MatcherState, Expected>; | ||
MatcherFunctionWithContext<MatcherContext, Expected>; | ||
export declare type MatcherFunctionWithState< | ||
State extends MatcherState = MatcherState, | ||
export declare type MatcherFunctionWithContext< | ||
Context extends MatcherContext = MatcherContext, | ||
Expected extends Array<any> = [] /** TODO should be: extends Array<unknown> = [] */, | ||
> = (this: State, actual: unknown, ...expected: Expected) => ExpectationResult; | ||
> = ( | ||
this: Context, | ||
actual: unknown, | ||
...expected: Expected | ||
) => ExpectationResult; | ||
@@ -312,14 +318,17 @@ export declare interface Matchers<R extends void | Promise<void>> { | ||
currentTestName?: string; | ||
dontThrow?(): void; | ||
error?: Error; | ||
equals: EqualsFunction; | ||
expand?: boolean; | ||
expectedAssertionsNumber?: number | null; | ||
expectedAssertionsNumber: number | null; | ||
expectedAssertionsNumberError?: Error; | ||
isExpectingAssertions?: boolean; | ||
isExpectingAssertions: boolean; | ||
isExpectingAssertionsError?: Error; | ||
isNot: boolean; | ||
promise: string; | ||
isNot?: boolean; | ||
promise?: string; | ||
suppressedErrors: Array<Error>; | ||
testPath?: string; | ||
} | ||
export declare interface MatcherUtils { | ||
dontThrow(): void; | ||
equals: EqualsFunction; | ||
utils: typeof jestMatcherUtils & { | ||
@@ -344,4 +353,4 @@ iterableEquality: Tester; | ||
declare type RawMatcherFn<State extends MatcherState = MatcherState> = { | ||
(this: State, actual: any, ...expected: Array<any>): ExpectationResult; | ||
declare type RawMatcherFn<Context extends MatcherContext = MatcherContext> = { | ||
(this: Context, actual: any, ...expected: Array<any>): ExpectationResult; | ||
}; | ||
@@ -348,0 +357,0 @@ |
@@ -271,3 +271,3 @@ 'use strict'; | ||
}; | ||
const matcherContext = { | ||
const matcherUtilsThing = { | ||
// When throws is disabled, the matcher will not throw errors during test | ||
@@ -279,8 +279,11 @@ // execution but instead add them to the global matcher state. If a | ||
dontThrow: () => (throws = false), | ||
equals: _expectUtils.equals, | ||
utils | ||
}; | ||
const matcherContext = { | ||
...(0, _jestMatchersObject.getState)(), | ||
equals: _expectUtils.equals, | ||
...matcherUtilsThing, | ||
error: err, | ||
isNot, | ||
promise, | ||
utils | ||
promise | ||
}; | ||
@@ -287,0 +290,0 @@ |
{ | ||
"name": "expect", | ||
"version": "29.0.0-alpha.4", | ||
"version": "29.0.0-alpha.6", | ||
"repository": { | ||
@@ -21,10 +21,10 @@ "type": "git", | ||
"dependencies": { | ||
"@jest/expect-utils": "^29.0.0-alpha.4", | ||
"@jest/expect-utils": "^29.0.0-alpha.6", | ||
"jest-get-type": "^29.0.0-alpha.3", | ||
"jest-matcher-utils": "^29.0.0-alpha.4", | ||
"jest-message-util": "^29.0.0-alpha.4", | ||
"jest-util": "^29.0.0-alpha.4" | ||
"jest-matcher-utils": "^29.0.0-alpha.6", | ||
"jest-message-util": "^29.0.0-alpha.6", | ||
"jest-util": "^29.0.0-alpha.6" | ||
}, | ||
"devDependencies": { | ||
"@jest/test-utils": "^29.0.0-alpha.4", | ||
"@jest/test-utils": "^29.0.0-alpha.6", | ||
"@tsd/typescript": "~4.7.4", | ||
@@ -42,3 +42,3 @@ "chalk": "^4.0.0", | ||
}, | ||
"gitHead": "98a833bd4bc0bdcfcee5d4f04c2833400c4e2933" | ||
"gitHead": "4def94b073cad300e99de378ba900e6ba9b7032f" | ||
} |
161264
21
4749
+ Added@types/node@20.12.12(transitive)
+ Addedpicocolors@1.0.1(transitive)
- Removed@types/node@20.12.11(transitive)
- Removedpicocolors@1.0.0(transitive)
Updatedjest-util@^29.0.0-alpha.6