From 50aaafe653630be98697ea65c1e19062c5080c55 Mon Sep 17 00:00:00 2001 From: Flarna Date: Sat, 24 Feb 2018 00:14:04 +0100 Subject: [PATCH] [sinon] add calledOnceWithExactly() and calledOnceWith() added in 4.3.0 --- types/sinon/index.d.ts | 4 +++- types/sinon/sinon-tests.ts | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/types/sinon/index.d.ts b/types/sinon/index.d.ts index f0433a694e..eb37be5e44 100644 --- a/types/sinon/index.d.ts +++ b/types/sinon/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Sinon 4.1 +// Type definitions for Sinon 4.3 // Project: http://sinonjs.org/ // Definitions by: William Sears // Jonathan Little @@ -26,6 +26,8 @@ declare namespace Sinon { calledOn(obj: any): boolean; calledWith(...args: any[]): boolean; calledWithExactly(...args: any[]): boolean; + calledOnceWith(...args: any[]): boolean; + calledOnceWithExactly(...args: any[]): boolean; calledWithMatch(...args: any[]): boolean; notCalledWith(...args: any[]): boolean; notCalledWithMatch(...args: any[]): boolean; diff --git a/types/sinon/sinon-tests.ts b/types/sinon/sinon-tests.ts index 2e2286e538..4311901355 100644 --- a/types/sinon/sinon-tests.ts +++ b/types/sinon/sinon-tests.ts @@ -85,6 +85,8 @@ function testNine() { callback.alwaysCalledWithMatch({ y: 5 }); callback.neverCalledWithMatch({ x: 6 }); callback.notCalledWithMatch({ x: 6 }); + callback.calledOnceWith({ x: 5, y: 5 }); + callback.calledOnceWithExactly({ x: 5, y: 5 }); sinon.assert.calledWithMatch(callback, { x: 5 }); sinon.assert.alwaysCalledWithMatch(callback, { y: 5 }); sinon.assert.neverCalledWithMatch(callback, { x: 6 });