refactor(core): cleanup SpyObject (#12221)
This commit is contained in:

committed by
Tobias Bosch

parent
91dd138fa5
commit
e6e007e2f1
@ -42,7 +42,7 @@ export function createPairedMessageBuses(): PairedMessageBuses {
|
||||
export function expectBrokerCall(
|
||||
broker: SpyMessageBroker, methodName: string, vals?: Array<any>,
|
||||
handler?: (..._: any[]) => Promise<any>| void): void {
|
||||
broker.spy('runOnService').andCallFake((args: UiArguments, returnType: Type<any>) => {
|
||||
broker.spy('runOnService').and.callFake((args: UiArguments, returnType: Type<any>) => {
|
||||
expect(args.method).toEqual(methodName);
|
||||
if (isPresent(vals)) {
|
||||
expect(args.args.length).toEqual(vals.length);
|
||||
|
@ -28,7 +28,7 @@ export function main() {
|
||||
|
||||
|
||||
function createWebWorkerPlatformLocation(loc: LocationType): WebWorkerPlatformLocation {
|
||||
broker.spy('runOnService').andCallFake((args: UiArguments, returnType: Type<any>) => {
|
||||
broker.spy('runOnService').and.callFake((args: UiArguments, returnType: Type<any>) => {
|
||||
if (args.method === 'getLocation') {
|
||||
return Promise.resolve(loc);
|
||||
}
|
||||
|
Reference in New Issue
Block a user