docs(http): fixed example unit test for error catching (#25306)
The example unit test should test the service when the backend application is not available, by providing a mock error response. Although, the test will fail as the mock response from the server is valid (it does not simulate a error response, but valid response with an error status 404). This merge request fix this issue by replacing MockResponse with MockError This PR resolves 19499 issue PR Close #25306
This commit is contained in:
parent
4eb8ac6de9
commit
637ae135c5
|
@ -176,7 +176,7 @@ export class MockConnection implements Connection {
|
|||
* this.heroService.getHeroes()
|
||||
* .then((heroes: String[]) => result = heroes)
|
||||
* .catch((error: any) => catchedError = error);
|
||||
* this.lastConnection.mockRespond(new Response(new ResponseOptions({
|
||||
* this.lastConnection.mockError(new Response(new ResponseOptions({
|
||||
* status: 404,
|
||||
* statusText: 'URL not Found',
|
||||
* })));
|
||||
|
|
Loading…
Reference in New Issue