0

Here i'm able to cover the positive flow but not able to cover .pipe(CatchError.. part

Service.ts

someFunction(Id: number, source: number, issueId: any): Observable<Summary> {
        return this.httpClient.get<Summary>(baseUrl + DomainEndpoint + '?id=' + Id  + '&source=' + source + '&issueId=' + issueId)
        .pipe(catchError(err => {
            return throwError(()=> new Error(err));
        }));
    }

I Want to cover the code coverage for this part also since it is less than expected ,could anyone please guide me through this.

DiTi
  • 1
  • 1
  • Here is how you can simulate an error: https://stackoverflow.com/a/46463377/7365461. In the code, you are catching and then throwing the error. It might be better off it was removed (it's doing nothing). – AliF50 Feb 06 '23 at 14:20

0 Answers0