From e4acd8354109fcc98f98cd5935c60795aded65d0 Mon Sep 17 00:00:00 2001 From: Bartosz Wyporkiewicz Date: Sat, 4 Aug 2018 17:05:46 +0100 Subject: [PATCH] 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 --- packages/http/testing/src/mock_backend.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/http/testing/src/mock_backend.ts b/packages/http/testing/src/mock_backend.ts index 31f72d68cf..5d6bdd173b 100644 --- a/packages/http/testing/src/mock_backend.ts +++ b/packages/http/testing/src/mock_backend.ts @@ -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', * })));