Merge pull request #23881 from Flarna/sinon_add_calledOnceWithExcatly

[sinon] add calledOnceWithExactly() and calledOnceWith() added in 4.3.0
This commit is contained in:
Benjamin Lichtman
2018-02-28 13:02:48 -08:00
committed by GitHub
2 changed files with 5 additions and 1 deletions
+3 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for Sinon 4.1
// Type definitions for Sinon 4.3
// Project: http://sinonjs.org/
// Definitions by: William Sears <https://github.com/mrbigdog2u>
// Jonathan Little <https://github.com/rationull>
@@ -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;
+2
View File
@@ -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 });