@@ -18,8 +18,8 @@ export type AsyncExpectationResult = Promise<SyncExpectationResult>;
18
18
export type ExpectationResult = SyncExpectationResult | AsyncExpectationResult ;
19
19
20
20
export type RawMatcherFn = (
21
+ received : any ,
21
22
expected : any ,
22
- actual : any ,
23
23
options ?: any ,
24
24
) => ExpectationResult ;
25
25
@@ -100,7 +100,7 @@ export interface Matchers<R> {
100
100
/**
101
101
* Ensure that a mock function is called with specific arguments on an Nth call.
102
102
*/
103
- nthCalledWith ( nthCall : number , ...params : Array < unknown > ) : R ;
103
+ nthCalledWith ( nthCall : number , ...args : Array < unknown > ) : R ;
104
104
/**
105
105
* Ensure that the nth call to a mock function has returned a specified value.
106
106
*/
@@ -159,7 +159,7 @@ export interface Matchers<R> {
159
159
* Ensure that an object is an instance of a class.
160
160
* This matcher uses `instanceof` underneath.
161
161
*/
162
- toBeInstanceOf ( expected : unknown ) : R ;
162
+ toBeInstanceOf ( expected : Function ) : R ;
163
163
/**
164
164
* For comparing floating point numbers.
165
165
*/
@@ -214,16 +214,16 @@ export interface Matchers<R> {
214
214
/**
215
215
* Ensure that a mock function is called with specific arguments.
216
216
*/
217
- toHaveBeenCalledWith ( ...params : Array < unknown > ) : R ;
217
+ toHaveBeenCalledWith ( ...args : Array < unknown > ) : R ;
218
218
/**
219
219
* Ensure that a mock function is called with specific arguments on an Nth call.
220
220
*/
221
- toHaveBeenNthCalledWith ( nthCall : number , ...params : Array < unknown > ) : R ;
221
+ toHaveBeenNthCalledWith ( nthCall : number , ...args : Array < unknown > ) : R ;
222
222
/**
223
223
* If you have a mock function, you can use `.toHaveBeenLastCalledWith`
224
224
* to test what arguments it was last called with.
225
225
*/
226
- toHaveBeenLastCalledWith ( ...params : Array < unknown > ) : R ;
226
+ toHaveBeenLastCalledWith ( ...args : Array < unknown > ) : R ;
227
227
/**
228
228
* Use to test the specific value that a mock function last returned.
229
229
* If the last call to the mock function threw an error, then this matcher will fail
@@ -254,7 +254,7 @@ export interface Matchers<R> {
254
254
*
255
255
* expect(houseForSale).toHaveProperty('kitchen.area', 20);
256
256
*/
257
- toHaveProperty ( propertyPath : string | Array < unknown > , value ?: unknown ) : R ;
257
+ toHaveProperty ( keyPath : string | Array < string > , value ?: unknown ) : R ;
258
258
/**
259
259
* Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time
260
260
*/
@@ -275,7 +275,7 @@ export interface Matchers<R> {
275
275
/**
276
276
* Used to check that a JavaScript object matches a subset of the properties of an object
277
277
*/
278
- toMatchObject ( expected : { } | Array < unknown > ) : R ;
278
+ toMatchObject ( expected : Record < string , unknown > | Array < unknown > ) : R ;
279
279
/**
280
280
* Ensure that a mock function has returned (as opposed to thrown) at least once.
281
281
*/
@@ -291,7 +291,7 @@ export interface Matchers<R> {
291
291
/**
292
292
* Use to test that objects have the same types as well as structure.
293
293
*/
294
- toStrictEqual ( expected : { } ) : R ;
294
+ toStrictEqual ( expected : unknown ) : R ;
295
295
/**
296
296
* Used to test that a function throws when it is called.
297
297
*/
0 commit comments