refactor(testing): remove deprecated test setup functions (#10600)
Remove test setup functions which were deprecated in rc5. See the changelog for rc5 for how to update. In brief, instead of `setBaseTestProviders`, use `TestBed.initTestEnvironment`.
This commit is contained in:

committed by
Alex Rickabaugh

parent
ebcd14f8e9
commit
d75502eeee
@ -378,46 +378,6 @@ export function getTestBed() {
|
||||
return _testBed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use getTestBed instead.
|
||||
*/
|
||||
export function getTestInjector() {
|
||||
return getTestBed();
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the providers that the test injector should use. These should be providers
|
||||
* common to every test in the suite.
|
||||
*
|
||||
* This may only be called once, to set up the common providers for the current test
|
||||
* suite on the current platform. If you absolutely need to change the providers,
|
||||
* first use `resetBaseTestProviders`.
|
||||
*
|
||||
* Test modules and platforms for individual platforms are available from
|
||||
* 'angular2/platform/testing/<platform_name>'.
|
||||
*
|
||||
* @deprecated Use TestBed.initTestEnvironment instead
|
||||
*/
|
||||
export function setBaseTestProviders(
|
||||
platformProviders: Array<Type|Provider|any[]>,
|
||||
applicationProviders: Array<Type|Provider|any[]>) {
|
||||
if (platformProviders.length === 1 && typeof platformProviders[0] === 'function') {
|
||||
(<any>platformProviders[0])(applicationProviders);
|
||||
} else {
|
||||
throw new Error(
|
||||
`setBaseTestProviders is deprecated and only supports platformProviders that are predefined by Angular. Use 'TestBed.initTestEnvironment' instead.`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset the providers for the test injector.
|
||||
*
|
||||
* @deprecated Use TestBed.resetTestEnvironment instead.
|
||||
*/
|
||||
export function resetBaseTestProviders() {
|
||||
TestBed.resetTestEnvironment();
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows injecting dependencies in `beforeEach()` and `it()`.
|
||||
*
|
||||
|
Reference in New Issue
Block a user