Merge pull request #21991 from 43081j/sinon-instance

sinon: add createStubInstance sandbox
This commit is contained in:
Mine Starks
2017-12-11 14:32:00 -08:00
committed by GitHub
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -495,6 +495,8 @@ declare namespace Sinon {
usingPromise(promiseLibrary: any): SinonSandbox;
verify(): void;
verifyAndRestore(): void;
createStubInstance(constructor: any): any;
createStubInstance<TType>(constructor: StubbableType<TType>): SinonStubbedInstance<TType>;
}
interface SinonSandboxStatic {
+2
View File
@@ -129,6 +129,8 @@ function testSandbox() {
sandbox.resetBehavior();
sandbox.verify();
sandbox.verifyAndRestore();
sandbox.createStubInstance(TestCreateStubInstance).someTestMethod('some argument');
sandbox.createStubInstance<TestCreateStubInstance>(TestCreateStubInstance).someTestMethod('some argument');
}
function testPromises() {