fix(core/testing compiler/testing): move TestComponentBuilder to core/testing (#9590)

TestComponentBuilder now lives in core/testing. compiler/testing contains a private
OverridingTestComponentBuilder implementation which handles the private behavior
we need to override templates. This is part of the effort to simplify the testing
imports and hide compiler APIs.

Closes #9585

BREAKING CHANGE:

`TestComponentBuilder` is now imported from `@angular/core/testing`. Imports
from `@angular/compiler/testing` are deprecated.

Before:

```
import {TestComponentBuilder, TestComponentRenderer, ComponentFixtureAutoDetect} from '@angular/compiler/testing';
```

After:
```
import {TestComponentBuilder, TestComponentRenderer, ComponentFixtureAutoDetect} from '@angular/core/testing';
```
This commit is contained in:
Julie Ralph
2016-06-24 17:35:01 -07:00
committed by GitHub
parent c693c03f1d
commit a33195dcf3
7 changed files with 221 additions and 129 deletions

View File

@ -7,8 +7,9 @@
*/
import {COMPILER_PROVIDERS, DirectiveResolver, ViewResolver, XHR} from '@angular/compiler';
import {MockDirectiveResolver, MockViewResolver, TestComponentBuilder, TestComponentRenderer} from '@angular/compiler/testing';
import {MockDirectiveResolver, MockViewResolver, OverridingTestComponentBuilder} from '@angular/compiler/testing';
import {APPLICATION_COMMON_PROVIDERS, APP_ID, NgZone, PLATFORM_COMMON_PROVIDERS, PLATFORM_INITIALIZER, RootRenderer} from '@angular/core';
import {TestComponentBuilder, TestComponentRenderer} from '@angular/core/testing';
import {AnimationDriver, NoOpAnimationDriver} from '../core_private';
import {DOMTestComponentRenderer} from '../platform_browser_dynamic_testing_private';
@ -71,9 +72,9 @@ export const TEST_SERVER_APPLICATION_PROVIDERS: Array<any /*Type | Provider | an
/* @ts2dart_Provider */ {provide: APP_ID, useValue: 'a'},
/* @ts2dart_Provider */ {provide: SharedStylesHost, useExisting: DomSharedStylesHost},
DomSharedStylesHost, ELEMENT_PROBE_PROVIDERS,
{provide: TestComponentBuilder, useClass: OverridingTestComponentBuilder},
/* @ts2dart_Provider */ {provide: DirectiveResolver, useClass: MockDirectiveResolver},
/* @ts2dart_Provider */ {provide: ViewResolver, useClass: MockViewResolver},
/* @ts2dart_Provider */ {provide: TestComponentRenderer, useClass: DOMTestComponentRenderer},
TestComponentBuilder,
/* @ts2dart_Provider */ {provide: NgZone, useFactory: createNgZone}
];