feat(core): Deprecate TestBed.get as deprecated (#32406)

From 9.0.0 use TestBed.inject
See #32200

Fixes #26491

PR Close #32406
This commit is contained in:
Carlos Ortiz García
2019-08-29 13:54:49 -07:00
committed by Matias Niemelä
parent 5356826a38
commit a85eccd6ff
4 changed files with 20 additions and 20 deletions

View File

@ -58,8 +58,8 @@ export interface TestBed {
configureTestingModule(moduleDef: TestModuleMetadata): void;
createComponent<T>(component: Type<T>): ComponentFixture<T>;
execute(tokens: any[], fn: Function, context?: any): any;
get(token: any, notFoundValue?: any): any;
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
/** @deprecated */ get(token: any, notFoundValue?: any): any;
/** @deprecated */ get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
inject<T>(token: Type<T> | InjectionToken<T> | AbstractType<T>, notFoundValue?: T, flags?: InjectFlags): T;
inject<T>(token: Type<T> | InjectionToken<T> | AbstractType<T>, notFoundValue: null, flags?: InjectFlags): T | null;
@ -95,8 +95,8 @@ export interface TestBedStatic {
}): TestBedStatic;
configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic;
createComponent<T>(component: Type<T>): ComponentFixture<T>;
get(token: any, notFoundValue?: any): any;
get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
/** @deprecated */ get(token: any, notFoundValue?: any): any;
/** @deprecated */ get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed;
inject<T>(token: Type<T> | InjectionToken<T> | AbstractType<T>, notFoundValue: null, flags?: InjectFlags): T | null;
inject<T>(token: Type<T> | InjectionToken<T> | AbstractType<T>, notFoundValue?: T, flags?: InjectFlags): T;