From 27f151b94445542adce2786c14f64ad582f9a30e Mon Sep 17 00:00:00 2001 From: 43081j <43081j@users.noreply.github.com> Date: Tue, 5 Dec 2017 21:47:23 +0000 Subject: [PATCH] add sinon createStubInstance --- types/sinon/index.d.ts | 2 ++ types/sinon/sinon-tests.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/types/sinon/index.d.ts b/types/sinon/index.d.ts index bc657ef79b..205a172e9a 100644 --- a/types/sinon/index.d.ts +++ b/types/sinon/index.d.ts @@ -495,6 +495,8 @@ declare namespace Sinon { usingPromise(promiseLibrary: any): SinonSandbox; verify(): void; verifyAndRestore(): void; + createStubInstance(constructor: any): any; + createStubInstance(constructor: StubbableType): SinonStubbedInstance; } interface SinonSandboxStatic { diff --git a/types/sinon/sinon-tests.ts b/types/sinon/sinon-tests.ts index 1fafb259ee..37f7d6d596 100644 --- a/types/sinon/sinon-tests.ts +++ b/types/sinon/sinon-tests.ts @@ -129,6 +129,8 @@ function testSandbox() { sandbox.resetBehavior(); sandbox.verify(); sandbox.verifyAndRestore(); + sandbox.createStubInstance(TestCreateStubInstance).someTestMethod('some argument'); + sandbox.createStubInstance(TestCreateStubInstance).someTestMethod('some argument'); } function testPromises() {