From 4942f142b68252caf861a4f514cfe4e85950f4f9 Mon Sep 17 00:00:00 2001 From: Viktor Zozuliak Date: Fri, 30 Dec 2016 15:34:59 +0100 Subject: [PATCH] [sinon] properly type sinon.createStubInstance (#13522) --- sinon/index.d.ts | 2 +- sinon/sinon-tests.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/sinon/index.d.ts b/sinon/index.d.ts index eb3b0bfa9f..966c7229d0 100644 --- a/sinon/index.d.ts +++ b/sinon/index.d.ts @@ -427,7 +427,7 @@ declare namespace Sinon { // Utility overridables interface SinonStatic { - createStubInstance(constructor: any): SinonStub; + createStubInstance(constructor: any): any; format(obj: any): string; log(message: string): void; restore(object: any): void; diff --git a/sinon/sinon-tests.ts b/sinon/sinon-tests.ts index fa1f313d7b..9a35166324 100644 --- a/sinon/sinon-tests.ts +++ b/sinon/sinon-tests.ts @@ -114,4 +114,8 @@ var clock = sinon.useFakeTimers(); clock.setSystemTime(1000); clock.setSystemTime(new Date()); +class TestCreateStubInstance { + someTestMethod(testArg : string) {}; +} +sinon.createStubInstance(TestCreateStubInstance).someTestMethod('some argument');