fix(core/testing): clean up the core testing public API (#9466)
Previously, we were exporting internal mocks and helpers. Move these to core/testing/testing_internal or remove them if they were never used. Remove deprecated items - injectAsync, clearPendingTimers. BREAKING CHANGE: Remove the following APIs from `@angular/core/testing`, which have been deprecated or were never intended to be publicly exported: ``` injectAsync clearPendingTimers Log MockAppliacationHref MockNgZone clearPendingTimers getTypeOf instantiateType ``` Instead of `injectAsync`, use `async(inject())`. `clearPendingTimers` is no longer required.
This commit is contained in:
@ -11,8 +11,7 @@ import {ApplicationRef, disposePlatform} from '@angular/core/src/application_ref
|
||||
import {Console} from '@angular/core/src/console';
|
||||
import {ComponentRef} from '@angular/core/src/linker/component_factory';
|
||||
import {Testability, TestabilityRegistry} from '@angular/core/src/testability/testability';
|
||||
import {Log} from '@angular/core/testing';
|
||||
import {AsyncTestCompleter, afterEach, beforeEach, describe, expect, inject, it} from '@angular/core/testing/testing_internal';
|
||||
import {AsyncTestCompleter, Log, afterEach, beforeEach, beforeEachProviders, describe, expect, inject, it} from '@angular/core/testing/testing_internal';
|
||||
import {BROWSER_APP_PROVIDERS, BROWSER_PLATFORM_PROVIDERS} from '@angular/platform-browser';
|
||||
import {BROWSER_APP_COMPILER_PROVIDERS, bootstrap} from '@angular/platform-browser-dynamic';
|
||||
import {getDOM} from '@angular/platform-browser/src/dom/dom_adapter';
|
||||
@ -89,6 +88,8 @@ export function main() {
|
||||
testProviders: any /** TODO #9100 */, lightDom: any /** TODO #9100 */;
|
||||
|
||||
describe('bootstrap factory method', () => {
|
||||
beforeEachProviders(() => { return [Log]; });
|
||||
|
||||
beforeEach(() => {
|
||||
disposePlatform();
|
||||
|
||||
|
Reference in New Issue
Block a user