Added assert, verify, and verifyAndRestore for SinonJS sandbox.

This commit is contained in:
Jonathan Little
2017-03-31 16:24:20 -07:00
parent 6057f7c6c6
commit 2f7adbeb8e
2 changed files with 8 additions and 0 deletions

View File

@@ -394,6 +394,7 @@ declare namespace Sinon {
}
interface SinonSandbox {
assert: SinonAssert;
clock: SinonFakeTimers;
requests: SinonFakeXMLHttpRequest;
server: SinonFakeServer;
@@ -407,6 +408,8 @@ declare namespace Sinon {
reset(): void;
resetHistory(): void;
resetBehavior(): void;
verify(): void;
verifyAndRestore(): void;
}
interface SinonSandboxStatic {

View File

@@ -90,6 +90,9 @@ function testNine() {
function testSandbox() {
var sandbox = sinon.sandbox.create();
sandbox.assert.notCalled(sinon.spy());
if (sandbox.spy().called) {
sandbox.stub(objectUnderTest, "process").yieldsTo("success");
sandbox.mock(objectUnderTest).expects("process").once();
@@ -101,6 +104,8 @@ function testSandbox() {
sandbox.reset();
sandbox.resetHistory();
sandbox.resetBehavior();
sandbox.verify();
sandbox.verifyAndRestore();
}
function testPromises() {