refactor(compiler): introduce TestBed.deprecatedOverrideProvider
(#19558)
This allows use to fix `TestBed.overrideProvider` to keep imported `NgModule`s eager, while allowing our users to still keep the old semantics until they have fixed their tests. PR Close #19558
This commit is contained in:

committed by
Chuck Jazdzewski

parent
6ade68cff1
commit
931cf78057
14
tools/public_api_guard/core/testing.d.ts
vendored
14
tools/public_api_guard/core/testing.d.ts
vendored
@ -71,6 +71,13 @@ export declare class TestBed implements Injector {
|
||||
}): void;
|
||||
configureTestingModule(moduleDef: TestModuleMetadata): void;
|
||||
createComponent<T>(component: Type<T>): ComponentFixture<T>;
|
||||
/** @deprecated */ deprecatedOverrideProvider(token: any, provider: {
|
||||
useFactory: Function;
|
||||
deps: any[];
|
||||
}): void;
|
||||
deprecatedOverrideProvider(token: any, provider: {
|
||||
useValue: any;
|
||||
}): void;
|
||||
execute(tokens: any[], fn: Function, context?: any): any;
|
||||
get(token: any, notFoundValue?: any): any;
|
||||
/** @experimental */ initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
|
||||
@ -94,6 +101,13 @@ export declare class TestBed implements Injector {
|
||||
}): typeof TestBed;
|
||||
static configureTestingModule(moduleDef: TestModuleMetadata): typeof TestBed;
|
||||
static createComponent<T>(component: Type<T>): ComponentFixture<T>;
|
||||
/** @deprecated */ static deprecatedOverrideProvider(token: any, provider: {
|
||||
useFactory: Function;
|
||||
deps: any[];
|
||||
}): void;
|
||||
static deprecatedOverrideProvider(token: any, provider: {
|
||||
useValue: any;
|
||||
}): void;
|
||||
static get(token: any, notFoundValue?: any): any;
|
||||
/** @experimental */ static initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed;
|
||||
static overrideComponent(component: Type<any>, override: MetadataOverride<Component>): typeof TestBed;
|
||||
|
Reference in New Issue
Block a user