refactor(testing): remove deprecated testing functions (#10832)
Remove TestComponentBuilder, addProviders, and withProviders. These were deprecated in rc5 - see the changelog for update information. Note - this does not actually remove the functions, but makes them internal only. They will be removed from the codebase entirely at a later time.
This commit is contained in:
@ -429,13 +429,6 @@ export class InjectSetupWrapper {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `TestBed.configureTestingModule instead.
|
||||
*/
|
||||
export function withProviders(providers: () => any) {
|
||||
return new InjectSetupWrapper(() => { return {providers: providers()}; });
|
||||
}
|
||||
|
||||
/**
|
||||
* @experimental
|
||||
*/
|
||||
|
@ -27,13 +27,6 @@ if (_global.beforeEach) {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows overriding default providers of the test injector,
|
||||
* which are defined in test_injector.js
|
||||
*
|
||||
* @deprecated Use `TestBed.configureTestingModule instead.
|
||||
*/
|
||||
export function addProviders(providers: Array<any>): void {
|
||||
if (!providers) return;
|
||||
TestBed.configureTestingModule({providers: providers});
|
||||
}
|
||||
// TODO(juliemr): remove this, only used because we need to export something to have compilation
|
||||
// work.
|
||||
export var __core_private_testing_placeholder__ = '';
|
||||
|
@ -10,7 +10,7 @@ import {StringMapWrapper} from '../src/facade/collection';
|
||||
import {Math, global, isFunction, isPromise} from '../src/facade/lang';
|
||||
|
||||
import {AsyncTestCompleter} from './async_test_completer';
|
||||
import {getTestBed, inject} from './test_bed';
|
||||
import {TestBed, getTestBed, inject} from './test_bed';
|
||||
|
||||
export {AsyncTestCompleter} from './async_test_completer';
|
||||
export {MockAnimationPlayer} from './mock_animation_player';
|
||||
@ -18,6 +18,7 @@ export {inject} from './test_bed';
|
||||
export * from './logger';
|
||||
export * from './ng_zone_mock';
|
||||
export * from './mock_application_ref';
|
||||
export * from './test_component_builder';
|
||||
|
||||
export var proxy: ClassDecorator = (t: any /** TODO #9100 */) => t;
|
||||
|
||||
@ -113,6 +114,18 @@ export function beforeEachProviders(fn: any /** TODO #9100 */): void {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows overriding default providers of the test injector,
|
||||
* which are defined in test_injector.js
|
||||
*
|
||||
* @deprecated Use `TestBed.configureTestingModule instead.
|
||||
*/
|
||||
export function addProviders(providers: Array<any>): void {
|
||||
if (!providers) return;
|
||||
TestBed.configureTestingModule({providers: providers});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
Reference in New Issue
Block a user