From ce4abcf585e1da3ce14c2f2f999a5b7a04644095 Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Sat, 9 Jun 2018 11:52:11 +0300 Subject: [PATCH] [jest] add toHaveBeenNthCalledWith matcher --- types/jest/index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/types/jest/index.d.ts b/types/jest/index.d.ts index af86996795..fd602b18d9 100644 --- a/types/jest/index.d.ts +++ b/types/jest/index.d.ts @@ -13,6 +13,7 @@ // Ahn // Josh Goldberg // Bradley Ayers +// Andrew Makarov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -473,6 +474,11 @@ declare namespace jest { * to test what arguments it was last called with. */ toHaveBeenLastCalledWith(...params: any[]): R; + /** + * If you have a mock function, you can use `.toHaveBeenNthCalledWith` + * to test what arguments it was nth called with. + */ + toHaveBeenNthCalledWith(nthCall: number, ...params: any[]): R; /** * Used to check that an object has a `.length` property * and it is set to a certain numeric value.