mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
@types/sinon: Added sinon.createSandbox and sinon.defaultConfig (#20451)
* Added sinon.createSandbox and sinon.defaultConfig * Combined sandbox.create() and createSandbox() overloads using optional parameter
This commit is contained in:
committed by
Wesley Wigham
parent
4f052feeaa
commit
b71b75d31d
Vendored
+3
-2
@@ -494,11 +494,12 @@ declare namespace Sinon {
|
||||
}
|
||||
|
||||
interface SinonSandboxStatic {
|
||||
create(): SinonSandbox;
|
||||
create(config: SinonSandboxConfig): SinonSandbox;
|
||||
create(config?: SinonSandboxConfig): SinonSandbox;
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
createSandbox(config?: SinonSandboxConfig): SinonSandbox;
|
||||
defaultConfig: SinonSandboxConfig;
|
||||
sandbox: SinonSandboxStatic;
|
||||
}
|
||||
|
||||
|
||||
@@ -97,7 +97,21 @@ function testAssert() {
|
||||
}
|
||||
|
||||
function testSandbox() {
|
||||
const config = {
|
||||
injectInto: null,
|
||||
properties: ["spy", "stub", "mock", "clock", "server", "requests"],
|
||||
useFakeServer: true,
|
||||
useFakeTimers: true,
|
||||
};
|
||||
|
||||
let sandbox = sinon.sandbox.create();
|
||||
sandbox = sinon.sandbox.create(config);
|
||||
sandbox = sinon.sandbox.create(sinon.defaultConfig);
|
||||
|
||||
sandbox = sinon.createSandbox();
|
||||
sandbox = sinon.createSandbox(config);
|
||||
sandbox = sinon.createSandbox(sinon.defaultConfig);
|
||||
|
||||
sandbox = sandbox.usingPromise(Promise);
|
||||
|
||||
sandbox.assert.notCalled(sinon.spy());
|
||||
|
||||
Reference in New Issue
Block a user