From a45a48d057d770dbe51cbdf6301b4a695703063d Mon Sep 17 00:00:00 2001 From: Marcin Dobosz Date: Mon, 11 Sep 2017 12:06:00 -0700 Subject: [PATCH] Add sinon.assert.match --- types/sinon/index.d.ts | 1 + types/sinon/sinon-tests.ts | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/types/sinon/index.d.ts b/types/sinon/index.d.ts index 30a64b9d81..f884f14b0a 100644 --- a/types/sinon/index.d.ts +++ b/types/sinon/index.d.ts @@ -363,6 +363,7 @@ declare namespace Sinon { alwaysThrew(spy: SinonSpy): void; alwaysThrew(spy: SinonSpy, exception: string): void; alwaysThrew(spy: SinonSpy, exception: any): void; + match(actual: any, expected: any): void; expose(obj: any, options?: SinonExposeOptions): void; } diff --git a/types/sinon/sinon-tests.ts b/types/sinon/sinon-tests.ts index 2897f6464b..b0a12c02ea 100644 --- a/types/sinon/sinon-tests.ts +++ b/types/sinon/sinon-tests.ts @@ -90,6 +90,12 @@ function testNine() { sinon.assert.neverCalledWithMatch(callback, { x: 6 }); } +function testAssert() { + sinon.assert.match(1, 1 + 1); + sinon.assert.match("abc", "abc"); + sinon.assert.match({ a: 1 }, { b: 2, c: "abc" }); +} + function testSandbox() { let sandbox = sinon.sandbox.create(); sandbox = sandbox.usingPromise(Promise);