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);