I have a method like below
service.myMethod(reqBody,true, false, false, (success) => {
},(failure)=>{
});
I want to spy on this method and want to mock the success callback and I have tried the following
const service = TestBed.get(Service);
spyOn(service, 'myMethod').and.callFake(function (reqBody, success,error) {
return success({});
});
Its throwing success is not a function. Also tried the following
spyOn(service, 'myMethod').and.callFake(function (reqBody,true,false,false, success,error) {
return success({});
});
Its showing compilation error.