const service = TestBed.get(GAService); spyOn(service , "sendException").and.returnValue(Promise.resolve(true)); // do some stuff that is expected to invoke GAService.sendException expect(service.sendException).toHaveBeenCalled();