mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This commit introduces the `provideHttpClientTesting()` function as an alternative to the `HttpClientTestingModule` (in fact, the NgModule is converted internally to just use the new provider function). PR Close #47502
22 lines
670 B
TypeScript
22 lines
670 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {HttpBackend, HttpClientModule} from '@angular/common/http';
|
|
import {NgModule, Provider} from '@angular/core';
|
|
|
|
import {HttpTestingController} from './api';
|
|
import {HttpClientTestingBackend} from './backend';
|
|
|
|
|
|
export function provideHttpClientTesting(): Provider[] {
|
|
return [
|
|
HttpClientTestingBackend,
|
|
{provide: HttpBackend, useExisting: HttpClientTestingBackend},
|
|
{provide: HttpTestingController, useExisting: HttpClientTestingBackend},
|
|
];
|
|
}
|