mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Added assert, verify, and verifyAndRestore for SinonJS sandbox.
This commit is contained in:
3
types/sinon/index.d.ts
vendored
3
types/sinon/index.d.ts
vendored
@@ -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 {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user