From d82912b20963d6cbc37511b8ad615499378a116c Mon Sep 17 00:00:00 2001 From: Joe Skeen Date: Wed, 22 Jul 2015 09:38:53 -0600 Subject: [PATCH] Added additional type information to the `calls` object for Jasmine Spies --- jasmine/jasmine.d.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/jasmine/jasmine.d.ts b/jasmine/jasmine.d.ts index bcbf986a1..581353b34 100644 --- a/jasmine/jasmine.d.ts +++ b/jasmine/jasmine.d.ts @@ -442,14 +442,21 @@ declare module jasmine { /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ allArgs(): any[]; /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ - all(): any; + all(): CallInfo[]; /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ - mostRecent(): any; + mostRecent(): CallInfo; /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ - first(): any; + first(): CallInfo; /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ reset(): void; } + + interface CallInfo { + /** The context (the this) for the call */ + object: any; + /** All arguments passed to the call */ + args: any[]; + } interface Util { inherit(childClass: Function, parentClass: Function): any;