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'
This commit is contained in:
Stewart Rand
2018-01-12 10:01:58 -08:00
committed by Ryan Cavanaugh
parent cae161a583
commit 5ee253b57e
+2 -2
View File
@@ -122,7 +122,7 @@ declare function spyOn<T>(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<T>(object: T, property: keyof T, accessType: string): jasmine.Spy;
declare function spyOnProperty<T>(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;
}