@@ -18,8 +18,8 @@ export type AsyncExpectationResult = Promise<SyncExpectationResult>;
1818export type ExpectationResult = SyncExpectationResult | AsyncExpectationResult ;
1919
2020export type RawMatcherFn = (
21+ received : any ,
2122 expected : any ,
22- actual : any ,
2323 options ?: any ,
2424) => ExpectationResult ;
2525
@@ -100,7 +100,7 @@ export interface Matchers<R> {
100100 /**
101101 * Ensure that a mock function is called with specific arguments on an Nth call.
102102 */
103- nthCalledWith ( nthCall : number , ...params : Array < unknown > ) : R ;
103+ nthCalledWith ( nthCall : number , ...args : Array < unknown > ) : R ;
104104 /**
105105 * Ensure that the nth call to a mock function has returned a specified value.
106106 */
@@ -159,7 +159,7 @@ export interface Matchers<R> {
159159 * Ensure that an object is an instance of a class.
160160 * This matcher uses `instanceof` underneath.
161161 */
162- toBeInstanceOf ( expected : unknown ) : R ;
162+ toBeInstanceOf ( expected : Function ) : R ;
163163 /**
164164 * For comparing floating point numbers.
165165 */
@@ -214,16 +214,16 @@ export interface Matchers<R> {
214214 /**
215215 * Ensure that a mock function is called with specific arguments.
216216 */
217- toHaveBeenCalledWith ( ...params : Array < unknown > ) : R ;
217+ toHaveBeenCalledWith ( ...args : Array < unknown > ) : R ;
218218 /**
219219 * Ensure that a mock function is called with specific arguments on an Nth call.
220220 */
221- toHaveBeenNthCalledWith ( nthCall : number , ...params : Array < unknown > ) : R ;
221+ toHaveBeenNthCalledWith ( nthCall : number , ...args : Array < unknown > ) : R ;
222222 /**
223223 * If you have a mock function, you can use `.toHaveBeenLastCalledWith`
224224 * to test what arguments it was last called with.
225225 */
226- toHaveBeenLastCalledWith ( ...params : Array < unknown > ) : R ;
226+ toHaveBeenLastCalledWith ( ...args : Array < unknown > ) : R ;
227227 /**
228228 * Use to test the specific value that a mock function last returned.
229229 * If the last call to the mock function threw an error, then this matcher will fail
@@ -254,7 +254,7 @@ export interface Matchers<R> {
254254 *
255255 * expect(houseForSale).toHaveProperty('kitchen.area', 20);
256256 */
257- toHaveProperty ( propertyPath : string | Array < unknown > , value ?: unknown ) : R ;
257+ toHaveProperty ( keyPath : string | Array < string > , value ?: unknown ) : R ;
258258 /**
259259 * Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time
260260 */
@@ -275,7 +275,7 @@ export interface Matchers<R> {
275275 /**
276276 * Used to check that a JavaScript object matches a subset of the properties of an object
277277 */
278- toMatchObject ( expected : { } | Array < unknown > ) : R ;
278+ toMatchObject ( expected : Record < string , unknown > | Array < unknown > ) : R ;
279279 /**
280280 * Ensure that a mock function has returned (as opposed to thrown) at least once.
281281 */
@@ -291,7 +291,7 @@ export interface Matchers<R> {
291291 /**
292292 * Use to test that objects have the same types as well as structure.
293293 */
294- toStrictEqual ( expected : { } ) : R ;
294+ toStrictEqual ( expected : unknown ) : R ;
295295 /**
296296 * Used to test that a function throws when it is called.
297297 */
0 commit comments