Merge pull request #15563 from rationull/sinon-2

Added assert, verify, and verifyAndRestore for SinonJS sandbox.
This commit is contained in:
Nathan Shively-Sanders
2017-04-04 08:49:20 -07:00
committed by GitHub
2 changed files with 8 additions and 0 deletions
+3
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 {
+5
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() {