From 90d86675eb10f1681ffeafb1d4672402d69c7617 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Mon, 19 Aug 2024 09:11:41 +0100 Subject: [PATCH] fix: Align RawMatcherFn type definition with Jest (#6351) --- packages/expect/src/jest-extend.ts | 1 - packages/expect/src/types.ts | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/expect/src/jest-extend.ts b/packages/expect/src/jest-extend.ts index 116a93e62c0d..5397429ff18a 100644 --- a/packages/expect/src/jest-extend.ts +++ b/packages/expect/src/jest-extend.ts @@ -75,7 +75,6 @@ function JestExtendPlugin( ) { const { state, isNot, obj } = getMatcherState(this, expect) - // @ts-expect-error args wanting tuple const result = expectAssertion.call(state, obj, ...args) if ( diff --git a/packages/expect/src/types.ts b/packages/expect/src/types.ts index 633f6212ce36..6f99e219dff6 100644 --- a/packages/expect/src/types.ts +++ b/packages/expect/src/types.ts @@ -85,7 +85,7 @@ export type AsyncExpectationResult = Promise export type ExpectationResult = SyncExpectationResult | AsyncExpectationResult export interface RawMatcherFn { - (this: T, received: any, expected: any, options?: any): ExpectationResult + (this: T, received: any, ...expected: Array): ExpectationResult } export type MatchersObject = Record<