| 
									
										
										
											
												refactor(testing): remove wrapping of Jasmine functions (#9564)
Instead, the async function now determines whether it should return a promise
or instead call a done function parameter. Importing Jasmine functions
from `@angular/core/testing` is no longer necessary and is now deprecated.
Additionally, beforeEachProviders is also deprecated, as it is specific
to the testing framework. Instead, use the new addProviders method directly.
Before:
```js
import {beforeEachProviders, it, describe, inject} from 'angular2/testing/core';
describe('my code', () => {
  beforeEachProviders(() => [MyService]);
  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
After:
```js
import {addProviders, inject} from 'angular2/testing/core';
describe('my code', () => {
  beforeEach(() => {
    addProviders([MyService]);
  });
  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
											
										 
											2016-06-24 17:48:35 -07:00
										 |  |  | export declare function async(fn: Function): (done: any) => any; | 
					
						
							| 
									
										
										
										
											2016-06-22 14:56:10 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-03 20:34:30 -08:00
										 |  |  | /** @experimental */ | 
					
						
							|  |  |  | export declare function cleanupDocument(): void; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-24 12:41:49 -07:00
										 |  |  | export declare class ComponentFixture<T> { | 
					
						
							|  |  |  |     changeDetectorRef: ChangeDetectorRef; | 
					
						
							| 
									
										
											  
											
												feat(browser): use AppModules for bootstrap in the browser
This introduces the `BrowserModule` to be used for long form
bootstrap and offline compile bootstrap:
```
@AppModule({
  modules: [BrowserModule],
  precompile: [MainComponent],
  providers: […], // additional providers
  directives: […], // additional platform directives
  pipes: […] // additional platform pipes
})
class MyModule {
  constructor(appRef: ApplicationRef) {
    appRef.bootstrap(MainComponent);
  }
}
// offline compile
import {bootstrapModuleFactory} from ‘@angular/platform-browser’;
bootstrapModuleFactory(MyModuleNgFactory);
// runtime compile long form
import {bootstrapModule} from ‘@angular/platform-browser-dynamic’;
bootstrapModule(MyModule);
```
The short form, `bootstrap(...)`, can now creates a module on the fly,
given `directives`, `pipes, `providers`, `precompile` and `modules`
properties.
Related changes:
- make `SanitizationService`, `SecurityContext` public in `@angular/core` so that the offline compiler can resolve the token
- move `AnimationDriver` to `platform-browser` and make it
  public so that the offline compiler can resolve the token
BREAKING CHANGES:
- short form bootstrap does no longer allow
  to inject compiler internals (i.e. everything 
  from `@angular/compiler). Inject `Compiler` instead.
  To provide custom providers for the compiler,
  create a custom compiler via `browserCompiler({providers: [...]})`
  and pass that into the `bootstrap` method.
											
										 
											2016-06-30 13:07:17 -07:00
										 |  |  |     componentInstance: T; | 
					
						
							| 
									
										
										
										
											2016-06-24 12:41:49 -07:00
										 |  |  |     componentRef: ComponentRef<T>; | 
					
						
							|  |  |  |     debugElement: DebugElement; | 
					
						
							|  |  |  |     elementRef: ElementRef; | 
					
						
							|  |  |  |     nativeElement: any; | 
					
						
							| 
									
										
										
										
											2017-03-29 09:34:45 -07:00
										 |  |  |     ngZone: NgZone | null; | 
					
						
							|  |  |  |     constructor(componentRef: ComponentRef<T>, ngZone: NgZone | null, _autoDetect: boolean); | 
					
						
							| 
									
										
										
										
											2016-06-24 12:41:49 -07:00
										 |  |  |     autoDetectChanges(autoDetect?: boolean): void; | 
					
						
							|  |  |  |     checkNoChanges(): void; | 
					
						
							|  |  |  |     destroy(): void; | 
					
						
							|  |  |  |     detectChanges(checkNoChanges?: boolean): void; | 
					
						
							|  |  |  |     isStable(): boolean; | 
					
						
							| 
									
										
										
										
											2017-05-12 16:49:16 -04:00
										 |  |  |     whenRenderingDone(): Promise<any>; | 
					
						
							| 
									
										
										
										
											2016-06-24 12:41:49 -07:00
										 |  |  |     whenStable(): Promise<any>; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2017-01-03 16:54:46 -08:00
										 |  |  | export declare const ComponentFixtureAutoDetect: InjectionToken<boolean[]>; | 
					
						
							| 
									
										
										
										
											2016-06-24 17:35:01 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2017-01-03 16:54:46 -08:00
										 |  |  | export declare const ComponentFixtureNoNgZone: InjectionToken<boolean[]>; | 
					
						
							| 
									
										
										
										
											2016-06-24 17:35:01 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2016-06-22 14:56:10 -07:00
										 |  |  | export declare function discardPeriodicTasks(): void; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-03 20:34:30 -08:00
										 |  |  | /** @experimental */ | 
					
						
							|  |  |  | export declare function ensureDocument(): void; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
											
												refactor(testing): remove wrapping of Jasmine functions (#9564)
Instead, the async function now determines whether it should return a promise
or instead call a done function parameter. Importing Jasmine functions
from `@angular/core/testing` is no longer necessary and is now deprecated.
Additionally, beforeEachProviders is also deprecated, as it is specific
to the testing framework. Instead, use the new addProviders method directly.
Before:
```js
import {beforeEachProviders, it, describe, inject} from 'angular2/testing/core';
describe('my code', () => {
  beforeEachProviders(() => [MyService]);
  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
After:
```js
import {addProviders, inject} from 'angular2/testing/core';
describe('my code', () => {
  beforeEach(() => {
    addProviders([MyService]);
  });
  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
											
										 
											2016-06-24 17:48:35 -07:00
										 |  |  | export declare function fakeAsync(fn: Function): (...args: any[]) => any; | 
					
						
							| 
									
										
										
										
											2016-06-22 14:56:10 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-22 11:19:21 -07:00
										 |  |  | /** @experimental */ | 
					
						
							|  |  |  | export declare function flush(maxTurns?: number): number; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2016-06-22 14:56:10 -07:00
										 |  |  | export declare function flushMicrotasks(): void; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2016-07-20 10:51:21 -07:00
										 |  |  | export declare function getTestBed(): TestBed; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
											
												refactor(testing): remove wrapping of Jasmine functions (#9564)
Instead, the async function now determines whether it should return a promise
or instead call a done function parameter. Importing Jasmine functions
from `@angular/core/testing` is no longer necessary and is now deprecated.
Additionally, beforeEachProviders is also deprecated, as it is specific
to the testing framework. Instead, use the new addProviders method directly.
Before:
```js
import {beforeEachProviders, it, describe, inject} from 'angular2/testing/core';
describe('my code', () => {
  beforeEachProviders(() => [MyService]);
  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
After:
```js
import {addProviders, inject} from 'angular2/testing/core';
describe('my code', () => {
  beforeEach(() => {
    addProviders([MyService]);
  });
  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
											
										 
											2016-06-24 17:48:35 -07:00
										 |  |  | export declare function inject(tokens: any[], fn: Function): () => any; | 
					
						
							| 
									
										
										
										
											2016-06-22 14:56:10 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2016-06-22 14:56:10 -07:00
										 |  |  | export declare class InjectSetupWrapper { | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  |     constructor(_moduleDef: () => TestModuleMetadata); | 
					
						
							| 
									
										
										
											
												refactor(testing): remove wrapping of Jasmine functions (#9564)
Instead, the async function now determines whether it should return a promise
or instead call a done function parameter. Importing Jasmine functions
from `@angular/core/testing` is no longer necessary and is now deprecated.
Additionally, beforeEachProviders is also deprecated, as it is specific
to the testing framework. Instead, use the new addProviders method directly.
Before:
```js
import {beforeEachProviders, it, describe, inject} from 'angular2/testing/core';
describe('my code', () => {
  beforeEachProviders(() => [MyService]);
  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
After:
```js
import {addProviders, inject} from 'angular2/testing/core';
describe('my code', () => {
  beforeEach(() => {
    addProviders([MyService]);
  });
  it('does stuff', inject([MyService], (service) => {
    // actual test
  });
});
```
											
										 
											2016-06-24 17:48:35 -07:00
										 |  |  |     inject(tokens: any[], fn: Function): () => any; | 
					
						
							| 
									
										
										
										
											2016-06-22 14:56:10 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  | /** @experimental */ | 
					
						
							|  |  |  | export declare type MetadataOverride<T> = { | 
					
						
							| 
									
										
										
										
											2018-05-24 15:49:07 +02:00
										 |  |  |     add?: Partial<T>; | 
					
						
							|  |  |  |     remove?: Partial<T>; | 
					
						
							|  |  |  |     set?: Partial<T>; | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-02 07:54:14 -07:00
										 |  |  | /** @experimental */ | 
					
						
							|  |  |  | export declare function resetFakeAsyncZone(): void; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-20 10:51:21 -07:00
										 |  |  | export declare class TestBed implements Injector { | 
					
						
							| 
									
										
										
										
											2017-03-10 16:55:32 -08:00
										 |  |  |     ngModule: Type<any> | Type<any>[]; | 
					
						
							| 
									
										
										
										
											2016-07-20 10:51:21 -07:00
										 |  |  |     platform: PlatformRef; | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  |     compileComponents(): Promise<any>; | 
					
						
							| 
									
										
										
										
											2016-07-20 10:51:21 -07:00
										 |  |  |     configureCompiler(config: { | 
					
						
							|  |  |  |         providers?: any[]; | 
					
						
							|  |  |  |         useJit?: boolean; | 
					
						
							|  |  |  |     }): void; | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  |     configureTestingModule(moduleDef: TestModuleMetadata): void; | 
					
						
							| 
									
										
										
										
											2016-08-10 18:21:28 -07:00
										 |  |  |     createComponent<T>(component: Type<T>): ComponentFixture<T>; | 
					
						
							| 
									
										
										
										
											2017-10-27 17:04:11 -07:00
										 |  |  |     deprecatedOverrideProvider(token: any, provider: { | 
					
						
							|  |  |  |         useValue: any; | 
					
						
							|  |  |  |     }): void; | 
					
						
							| 
									
										
										
										
											2017-10-09 14:09:01 -07:00
										 |  |  |     /** @deprecated */ deprecatedOverrideProvider(token: any, provider: { | 
					
						
							|  |  |  |         useFactory: Function; | 
					
						
							|  |  |  |         deps: any[]; | 
					
						
							|  |  |  |     }): void; | 
					
						
							| 
									
										
										
										
											2016-12-31 11:50:03 +01:00
										 |  |  |     execute(tokens: any[], fn: Function, context?: any): any; | 
					
						
							| 
									
										
										
										
											2016-07-20 10:51:21 -07:00
										 |  |  |     get(token: any, notFoundValue?: any): any; | 
					
						
							| 
									
										
										
										
											2017-04-26 09:24:42 -07:00
										 |  |  |     /** @experimental */ initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void; | 
					
						
							| 
									
										
										
										
											2016-09-12 19:34:14 -07:00
										 |  |  |     overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void; | 
					
						
							|  |  |  |     overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void; | 
					
						
							|  |  |  |     overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void; | 
					
						
							|  |  |  |     overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void; | 
					
						
							| 
									
										
										
										
											2017-05-15 13:12:10 -07:00
										 |  |  |     overrideProvider(token: any, provider: { | 
					
						
							|  |  |  |         useFactory: Function; | 
					
						
							|  |  |  |         deps: any[]; | 
					
						
							|  |  |  |     }): void; | 
					
						
							|  |  |  |     overrideProvider(token: any, provider: { | 
					
						
							|  |  |  |         useValue: any; | 
					
						
							|  |  |  |     }): void; | 
					
						
							| 
									
										
										
										
											2017-10-27 17:04:11 -07:00
										 |  |  |     overrideTemplateUsingTestingModule(component: Type<any>, template: string): void; | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  |     /** @experimental */ resetTestEnvironment(): void; | 
					
						
							|  |  |  |     resetTestingModule(): void; | 
					
						
							|  |  |  |     static compileComponents(): Promise<any>; | 
					
						
							|  |  |  |     static configureCompiler(config: { | 
					
						
							|  |  |  |         providers?: any[]; | 
					
						
							|  |  |  |         useJit?: boolean; | 
					
						
							|  |  |  |     }): typeof TestBed; | 
					
						
							|  |  |  |     static configureTestingModule(moduleDef: TestModuleMetadata): typeof TestBed; | 
					
						
							| 
									
										
										
										
											2016-08-10 18:21:28 -07:00
										 |  |  |     static createComponent<T>(component: Type<T>): ComponentFixture<T>; | 
					
						
							| 
									
										
										
										
											2017-10-27 17:04:11 -07:00
										 |  |  |     static deprecatedOverrideProvider(token: any, provider: { | 
					
						
							|  |  |  |         useValue: any; | 
					
						
							|  |  |  |     }): void; | 
					
						
							| 
									
										
										
										
											2017-10-09 14:09:01 -07:00
										 |  |  |     /** @deprecated */ static deprecatedOverrideProvider(token: any, provider: { | 
					
						
							|  |  |  |         useFactory: Function; | 
					
						
							|  |  |  |         deps: any[]; | 
					
						
							|  |  |  |     }): void; | 
					
						
							| 
									
										
										
										
											2016-08-16 20:49:07 -07:00
										 |  |  |     static get(token: any, notFoundValue?: any): any; | 
					
						
							| 
									
										
										
										
											2017-04-26 09:24:42 -07:00
										 |  |  |     /** @experimental */ static initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed; | 
					
						
							| 
									
										
										
										
											2016-09-12 19:34:14 -07:00
										 |  |  |     static overrideComponent(component: Type<any>, override: MetadataOverride<Component>): typeof TestBed; | 
					
						
							|  |  |  |     static overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): typeof TestBed; | 
					
						
							|  |  |  |     static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): typeof TestBed; | 
					
						
							|  |  |  |     static overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): typeof TestBed; | 
					
						
							| 
									
										
										
										
											2017-05-15 13:12:10 -07:00
										 |  |  |     static overrideProvider(token: any, provider: { | 
					
						
							|  |  |  |         useFactory: Function; | 
					
						
							|  |  |  |         deps: any[]; | 
					
						
							| 
									
										
										
										
											2017-11-06 11:20:45 -08:00
										 |  |  |     }): typeof TestBed; | 
					
						
							| 
									
										
										
										
											2017-05-15 13:12:10 -07:00
										 |  |  |     static overrideProvider(token: any, provider: { | 
					
						
							|  |  |  |         useValue: any; | 
					
						
							| 
									
										
										
										
											2017-11-06 11:20:45 -08:00
										 |  |  |     }): typeof TestBed; | 
					
						
							| 
									
										
										
										
											2016-12-15 02:05:17 +03:00
										 |  |  |     static overrideTemplate(component: Type<any>, template: string): typeof TestBed; | 
					
						
							| 
									
										
										
										
											2017-10-27 17:04:11 -07:00
										 |  |  |     static overrideTemplateUsingTestingModule(component: Type<any>, template: string): typeof TestBed; | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  |     /** @experimental */ static resetTestEnvironment(): void; | 
					
						
							|  |  |  |     static resetTestingModule(): typeof TestBed; | 
					
						
							| 
									
										
										
										
											2016-07-20 10:51:21 -07:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2016-06-24 17:35:01 -07:00
										 |  |  | export declare class TestComponentRenderer { | 
					
						
							|  |  |  |     insertRootElement(rootElementId: string): void; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  | export declare type TestModuleMetadata = { | 
					
						
							| 
									
										
											  
											
												feat(testing): add implicit test module
Every test now has an implicit module. It can be configured via `configureModule` (from @angular/core/testing)
to add providers, directives, pipes, ...
The compiler now has to be configured separately via `configureCompiler` (from @angular/core/testing)
to add providers or define whether to use jit.
BREAKING CHANGE:
- Application providers can no longer inject compiler internals (i.e. everything
  from `@angular/compiler). Inject `Compiler` instead. This reflects the
  changes to `bootstrap` for module support (3f55aa609f60f130f1d69188ed057214b1267cb3).
- Compiler providers can no longer be added via `addProviders` / `withProviders`.
  Use the new method `configureCompiler` instead.
- Platform directives / pipes need to be provided via
  `configureModule` and can no longer be provided via the
  `PLATFORM_PIPES` / `PLATFORM_DIRECTIVES` tokens.
- `setBaseTestProviders()` was renamed into `initTestEnvironment` and 
  now takes a `PlatformRef` and a factory for a
  `Compiler`.
- E.g. for the browser platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
  
  setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);   
  ```
  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {browserTestCompiler, browserDynamicTestPlatform,
      BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      browserTestCompiler,
      browserDynamicTestPlatform(),
      BrowserDynamicTestModule);
  ```
- E.g. for the server platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
  
  setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS);   
  ```
  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {serverTestCompiler, serverTestPlatform,
      ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      serverTestCompiler,
      serverTestPlatform(),
      ServerTestModule);
  ```
Related to #9726
Closes #9846
											
										 
											2016-07-04 09:37:30 -07:00
										 |  |  |     providers?: any[]; | 
					
						
							| 
									
										
										
										
											2016-07-18 03:50:31 -07:00
										 |  |  |     declarations?: any[]; | 
					
						
							|  |  |  |     imports?: any[]; | 
					
						
							| 
									
										
										
										
											2016-07-25 05:47:16 -07:00
										 |  |  |     schemas?: Array<SchemaMetadata | any[]>; | 
					
						
							| 
									
										
										
										
											2017-10-27 17:04:11 -07:00
										 |  |  |     aotSummaries?: () => any[]; | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /** @experimental */ | 
					
						
							|  |  |  | export declare function tick(millis?: number): void; | 
					
						
							| 
									
										
											  
											
												feat(testing): add implicit test module
Every test now has an implicit module. It can be configured via `configureModule` (from @angular/core/testing)
to add providers, directives, pipes, ...
The compiler now has to be configured separately via `configureCompiler` (from @angular/core/testing)
to add providers or define whether to use jit.
BREAKING CHANGE:
- Application providers can no longer inject compiler internals (i.e. everything
  from `@angular/compiler). Inject `Compiler` instead. This reflects the
  changes to `bootstrap` for module support (3f55aa609f60f130f1d69188ed057214b1267cb3).
- Compiler providers can no longer be added via `addProviders` / `withProviders`.
  Use the new method `configureCompiler` instead.
- Platform directives / pipes need to be provided via
  `configureModule` and can no longer be provided via the
  `PLATFORM_PIPES` / `PLATFORM_DIRECTIVES` tokens.
- `setBaseTestProviders()` was renamed into `initTestEnvironment` and 
  now takes a `PlatformRef` and a factory for a
  `Compiler`.
- E.g. for the browser platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS} from ‘@angular/platform-browser-dynamic/testing’;
  
  setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
      TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);   
  ```
  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {browserTestCompiler, browserDynamicTestPlatform,
      BrowserDynamicTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      browserTestCompiler,
      browserDynamicTestPlatform(),
      BrowserDynamicTestModule);
  ```
- E.g. for the server platform:
  
  BEFORE:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS} from ‘@angular/platform-server/testing/server’;
  
  setBaseTestProviders(TEST_SERVER_PLATFORM_PROVIDERS,
      TEST_SERVER_APPLICATION_PROVIDERS);   
  ```
  AFTER:
  ```
  import {setBaseTestProviders} from ‘@angular/core/testing’;
  import {serverTestCompiler, serverTestPlatform,
      ServerTestModule} from ‘@angular/platform-browser-dynamic/testing’;
  
  initTestEnvironment(
      serverTestCompiler,
      serverTestPlatform(),
      ServerTestModule);
  ```
Related to #9726
Closes #9846
											
										 
											2016-07-04 09:37:30 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-02-03 20:34:30 -08:00
										 |  |  | /** @experimental */ | 
					
						
							|  |  |  | export declare function withBody<T>(html: string, blockFn: T): T; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-27 12:27:23 -07:00
										 |  |  | /** @experimental */ | 
					
						
							| 
									
										
										
										
											2016-07-29 04:19:02 -07:00
										 |  |  | export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper; | 
					
						
							| 
									
										
										
										
											2018-03-09 15:45:11 +01:00
										 |  |  | export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any; |