docs(aio): update docs error in guide/http (#23567)

Updates documentation to include examples for both req.flush and
req.error in http testing examples.

PR Close #23567
This commit is contained in:
Bennett Hardwick
2018-04-27 20:44:07 +10:00
committed by Igor Minar
parent 1ab5fba92e
commit 2e5457c824
2 changed files with 11 additions and 3 deletions

View File

@ -150,7 +150,7 @@ describe('HttpClient testing', () => {
// Create mock ErrorEvent, raised when something goes wrong at the network level.
// Connection timeout, DNS error, offline, etc
const errorEvent = new ErrorEvent('so sad', {
const mockError = new ErrorEvent('Network error', {
message: emsg,
// #enddocregion network-error
// The rest of this is optional and not used.
@ -162,7 +162,7 @@ describe('HttpClient testing', () => {
});
// Respond with mock error
req.error(errorEvent);
req.error(mockError);
});
// #enddocregion network-error