This is the archived documentation for Angular v6. Please visit angular.io to see documentation for the current version of Angular.

HttpClientTestingModule

Configures HttpClientTestingBackend as the HttpBackend used by HttpClient.

See more...

      
      class HttpClientTestingModule {
}
    

Description

Inject HttpTestingController to expect and flush requests in your tests.

Providers

Provider
HttpClientTestingBackend
      
      HttpClientTestingBackend
    
{ provide: HttpBackend, useExisting: HttpClientTestingBackend }
      
      { provide: HttpBackend, useExisting: HttpClientTestingBackend }
    
{ provide: HttpTestingController, useExisting: HttpClientTestingBackend }
      
      { provide: HttpTestingController, useExisting: HttpClientTestingBackend }