From 0babed6558361ac4d780d8d153030f47cd8fafae Mon Sep 17 00:00:00 2001 From: Alex Varju Date: Wed, 18 Sep 2013 18:35:20 -0700 Subject: [PATCH] make sinon signatures --noImplicitAny friendly --- sinon/sinon-tests.ts | 6 +++--- sinon/sinon.d.ts | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/sinon/sinon-tests.ts b/sinon/sinon-tests.ts index 60751e908..b9b71c10e 100644 --- a/sinon/sinon-tests.ts +++ b/sinon/sinon-tests.ts @@ -1,7 +1,7 @@ /// -function once(fn) { - var returnValue, called = false; +function once(fn: Function) { + var returnValue: any, called = false; return function () { if (!called) { called = true; @@ -52,7 +52,7 @@ function testFive() { } var objectUnderTest: any = { - process: function (obj) { + process: function (obj: any) { // It doesn't really matter what's here because the stub is going to replace this function var dummy = true; if (dummy) { return obj.success(99); } else { obj.failure(99); } diff --git a/sinon/sinon.d.ts b/sinon/sinon.d.ts index 61dfafa10..a33d65dfe 100644 --- a/sinon/sinon.d.ts +++ b/sinon/sinon.d.ts @@ -60,20 +60,20 @@ interface SinonSpy extends SinonSpyCallApi { calledAfter(anotherSpy: SinonSpy): boolean; calledWithNew(spy: SinonSpy): boolean; withArgs(...args: any[]): SinonSpy; - alwaysCalledOn(obj: any); - alwaysCalledWith(...args: any[]); - alwaysCalledWithExactly(...args: any[]); - alwaysCalledWithMatch(...args: SinonMatcher[]); - neverCalledWith(...args: any[]); - neverCalledWithMatch(...args: SinonMatcher[]); + alwaysCalledOn(obj: any): boolean; + alwaysCalledWith(...args: any[]): boolean; + alwaysCalledWithExactly(...args: any[]): boolean; + alwaysCalledWithMatch(...args: SinonMatcher[]): boolean; + neverCalledWith(...args: any[]): boolean; + neverCalledWithMatch(...args: SinonMatcher[]): boolean; alwaysThrew(): boolean; - alwaysThrew(type: string); - alwaysThrew(obj: any); + alwaysThrew(type: string): boolean; + alwaysThrew(obj: any): boolean; alwaysReturned(): boolean; invokeCallback(...args: any[]): void; getCall(n: number): SinonSpyCall; reset(): void; - printf(format: string, ...args: any[]); + printf(format: string, ...args: any[]): string; restore(): void; } @@ -208,7 +208,7 @@ interface SinonFakeXMLHttpRequest { // Methods restore(): void; useFilters: boolean; - addFilter(filter: (method, url, async, username, password) => boolean): void; + addFilter(filter: (method: string, url: string, async: boolean, username: string, password: string) => boolean): void; setResponseHeaders(headers: any): void; setResponseBody(body: string): void; respond(status: number, headers: any, body: string): void;