From 5ee253b57e696fd64e8f7757e5522bbe15d685ca Mon Sep 17 00:00:00 2001 From: Stewart Rand Date: Fri, 12 Jan 2018 14:01:58 -0400 Subject: [PATCH] Jasmine: Parameter accessType should be optional and have specific possible values in spyOnProperty() (#22849) * Update parameter to be option for Jasmine spyOnProperty * Constrain possible values of accessType to 'get' and 'set' --- types/jasmine/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/jasmine/index.d.ts b/types/jasmine/index.d.ts index cc28931542..ed068f4775 100644 --- a/types/jasmine/index.d.ts +++ b/types/jasmine/index.d.ts @@ -122,7 +122,7 @@ declare function spyOn(object: T, method: keyof T): jasmine.Spy; * @param property The name of the property to replace with a Spy * @param accessType The access type (get|set) of the property to Spy on. */ -declare function spyOnProperty(object: T, property: keyof T, accessType: string): jasmine.Spy; +declare function spyOnProperty(object: T, property: keyof T, accessType?: 'get' | 'set'): jasmine.Spy; declare function runs(asyncMethod: Function): void; declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; @@ -579,7 +579,7 @@ declare namespace jasmine { addBeforesAndAftersToQueue(): void; explodes(): void; spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; - spyOnProperty(object: any, property: string, accessType: string): Spy; + spyOnProperty(object: any, property: string, accessType?: 'get' | 'set'): Spy; removeAllSpies(): void; throwOnExpectationFailure: boolean; }