fix(testing): reintroduce and deprecate setBaseTestProviders (#9905)
This change reverts the removal of setBaseTestProviders that was introduced in8d746e3f67
. Instead, setBaseTestProviders and the providers provided from `@angular/platform-browser-dynamic/testing` and `@angular/server/testing` will still work for the next release, but are deprecated. See8d746e3f67
for how to upgrade.
This commit is contained in:
@ -10,7 +10,7 @@ import {CompilerConfig, DirectiveResolver, ViewResolver} from '@angular/compiler
|
||||
import {MockDirectiveResolver, MockViewResolver, OverridingTestComponentBuilder} from '@angular/compiler/testing';
|
||||
import {AppModule, Compiler, CompilerFactory, PlatformRef, Provider, ReflectiveInjector, Type, createPlatformFactory} from '@angular/core';
|
||||
import {TestComponentBuilder, TestComponentRenderer} from '@angular/core/testing';
|
||||
import {BrowserTestModule, TEST_BROWSER_PLATFORM_PROVIDERS} from '@angular/platform-browser/testing';
|
||||
import {BrowserTestModule, TEST_BROWSER_APPLICATION_PROVIDERS, TEST_BROWSER_PLATFORM_PROVIDERS} from '@angular/platform-browser/testing';
|
||||
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS, BROWSER_DYNAMIC_COMPILER_FACTORY, BROWSER_DYNAMIC_PLATFORM_PROVIDERS} from './index';
|
||||
import {DOMTestComponentRenderer} from './testing/dom_test_component_renderer';
|
||||
@ -60,4 +60,20 @@ export const browserDynamicTestPlatform =
|
||||
]
|
||||
})
|
||||
export class BrowserDynamicTestModule {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use initTestEnvironment with browserDynamicTestPlatform instead.
|
||||
*/
|
||||
export const TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS: Array<any /*Type | Provider | any[]*/> =
|
||||
BROWSER_DYNAMIC_TEST_PLATFORM_PROVIDERS;
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated Use initTestEnvironment with BrowserDynamicTestModule instead.
|
||||
*/
|
||||
export const TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS: Array<any /*Type | Provider | any[]*/> = [
|
||||
TEST_BROWSER_APPLICATION_PROVIDERS,
|
||||
{provide: TestComponentBuilder, useClass: OverridingTestComponentBuilder},
|
||||
{provide: TestComponentRenderer, useClass: DOMTestComponentRenderer},
|
||||
];
|
||||
|
Reference in New Issue
Block a user