From da3c3e1661d2c23be11c9c99ca8690fadf877a72 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Mon, 11 Mar 2019 10:27:18 +0100 Subject: [PATCH] PR feedback --- packages/expect/src/types.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/expect/src/types.ts b/packages/expect/src/types.ts index b095562643a0..4d583a74d62a 100644 --- a/packages/expect/src/types.ts +++ b/packages/expect/src/types.ts @@ -18,8 +18,8 @@ export type AsyncExpectationResult = Promise; export type ExpectationResult = SyncExpectationResult | AsyncExpectationResult; export type RawMatcherFn = ( + received: any, expected: any, - actual: any, options?: any, ) => ExpectationResult; @@ -100,7 +100,7 @@ export interface Matchers { /** * Ensure that a mock function is called with specific arguments on an Nth call. */ - nthCalledWith(nthCall: number, ...params: Array): R; + nthCalledWith(nthCall: number, ...args: Array): R; /** * Ensure that the nth call to a mock function has returned a specified value. */ @@ -159,7 +159,7 @@ export interface Matchers { * Ensure that an object is an instance of a class. * This matcher uses `instanceof` underneath. */ - toBeInstanceOf(expected: unknown): R; + toBeInstanceOf(expected: Function): R; /** * For comparing floating point numbers. */ @@ -214,16 +214,16 @@ export interface Matchers { /** * Ensure that a mock function is called with specific arguments. */ - toHaveBeenCalledWith(...params: Array): R; + toHaveBeenCalledWith(...args: Array): R; /** * Ensure that a mock function is called with specific arguments on an Nth call. */ - toHaveBeenNthCalledWith(nthCall: number, ...params: Array): R; + toHaveBeenNthCalledWith(nthCall: number, ...args: Array): R; /** * If you have a mock function, you can use `.toHaveBeenLastCalledWith` * to test what arguments it was last called with. */ - toHaveBeenLastCalledWith(...params: Array): R; + toHaveBeenLastCalledWith(...args: Array): R; /** * Use to test the specific value that a mock function last returned. * If the last call to the mock function threw an error, then this matcher will fail @@ -254,7 +254,7 @@ export interface Matchers { * * expect(houseForSale).toHaveProperty('kitchen.area', 20); */ - toHaveProperty(propertyPath: string | Array, value?: unknown): R; + toHaveProperty(keyPath: string | Array, value?: unknown): R; /** * Use to test that the mock function successfully returned (i.e., did not throw an error) at least one time */ @@ -275,7 +275,7 @@ export interface Matchers { /** * Used to check that a JavaScript object matches a subset of the properties of an object */ - toMatchObject(expected: {} | Array): R; + toMatchObject(expected: Record | Array): R; /** * Ensure that a mock function has returned (as opposed to thrown) at least once. */ @@ -291,7 +291,7 @@ export interface Matchers { /** * Use to test that objects have the same types as well as structure. */ - toStrictEqual(expected: {}): R; + toStrictEqual(expected: unknown): R; /** * Used to test that a function throws when it is called. */