Add sinon.assert.match

This commit is contained in:
Marcin Dobosz
2017-09-11 12:06:00 -07:00
parent 1009717327
commit a45a48d057
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -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;
}
+6
View File
@@ -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);