From 9231e42aa8fda4355ab562fe037f7e6cb702009e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20L=C3=A9vesque?= Date: Mon, 9 Oct 2023 09:28:54 -0400 Subject: [PATCH] Mark toHaveBeenCalledBefore and After's second parameter as optional (#650) * Mark toHaveBeenCalledBefore's second parameter as optional `toHaveBeenCalledBefore`'s first parameter should be optional because it has a default value. * Mark toHaveBeenCalledAfter's second parameter as optional --- types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index a0cef966..9436c25c 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -146,7 +146,7 @@ interface CustomMatchers extends Record { * @param {Mock} mock * @param {boolean} [failIfNoSecondInvocation=true] */ - toHaveBeenCalledBefore(mock: jest.MockInstance, failIfNoSecondInvocation: boolean): R; + toHaveBeenCalledBefore(mock: jest.MockInstance, failIfNoSecondInvocation?: boolean): R; /** * Use `.toHaveBeenCalledAfter` when checking if a `Mock` was called after another `Mock`. @@ -156,7 +156,7 @@ interface CustomMatchers extends Record { * @param {Mock} mock * @param {boolean} [failIfNoFirstInvocation=true] */ - toHaveBeenCalledAfter(mock: jest.MockInstance, failIfNoFirstInvocation: boolean): R; + toHaveBeenCalledAfter(mock: jest.MockInstance, failIfNoFirstInvocation?: boolean): R; /** * Use `.toHaveBeenCalledOnce` to check if a `Mock` was called exactly one time.