fix(testing): reintroduce and deprecate setBaseTestProviders (#9905)

This change reverts the removal of setBaseTestProviders that was
introduced in 8d746e3f67.

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.

See 8d746e3f67 for how to upgrade.
This commit is contained in:
Julie Ralph
2016-07-11 14:01:11 -07:00
committed by GitHub
parent e68252a79b
commit 29231877e6
8 changed files with 96 additions and 5 deletions

View File

@ -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},
];