Não estou conseguindo passar essa linha de teste, porque o retorno dele esta esperando outra função.Segue o erro abaixo:
TypeError: Cannot read properties of undefined (reading 'createRequest')
TsFile
findById(id: string){
let parameters: JavaConnectorParameters = new JavaConnectorParameters();
parameters.addParam('id', id);
return this.javaConnector.createRequest(RestMethod.GET, this.restMapping, '/find-by-id', parameters);
}
specFile
it('should call the service', () => {
service.findById('id');
spyOn(ProgressCheckListAPI.prototype, "findById").and.callThrough();
ProgressCheckListAPI.prototype.findById('id');
expect(service.findById).toHaveBeenCalled();
});