Here is my solution for the ones using Rxjs 6
let mockService = {
getData: () => {
return of({data:'any data'});
}
}
spyOn(mockService , 'getData').and.callFake(() => {
return throwError(new Error('Fake error'));
});
Here is my solution for the ones using Rxjs 6
let mockService = {
getData: () => {
return of({data:'any data'});
}
}
spyOn(mockService , 'getData').and.callFake(() => {
return throwError(new Error('Fake error'));
});