2016-06-27 12:27:23 -07:00
|
|
|
/** @stable */
|
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
|
|
|
|
2016-06-27 12:27:23 -07:00
|
|
|
/** @stable */
|
2016-06-24 12:41:49 -07:00
|
|
|
export declare class ComponentFixture<T> {
|
|
|
|
|
changeDetectorRef: ChangeDetectorRef;
|
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;
|
|
|
|
|
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;
|
|
|
|
|
|
2016-06-27 12:27:23 -07:00
|
|
|
/** @experimental */
|
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
|
|
|
|
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;
|
|
|
|
|
|
2016-06-27 12:27:23 -07:00
|
|
|
/** @stable */
|
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);
|
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> = {
|
|
|
|
|
add?: T;
|
|
|
|
|
remove?: T;
|
|
|
|
|
set?: T;
|
|
|
|
|
};
|
|
|
|
|
|
2016-08-02 07:54:14 -07:00
|
|
|
/** @experimental */
|
|
|
|
|
export declare function resetFakeAsyncZone(): void;
|
|
|
|
|
|
2016-09-22 10:32:17 -07:00
|
|
|
/** @stable */
|
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>;
|
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-03-10 16:55:32 -08:00
|
|
|
/** @experimental */ initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef): 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;
|
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>;
|
2016-08-16 20:49:07 -07:00
|
|
|
static get(token: any, notFoundValue?: any): any;
|
2017-03-10 16:55:32 -08:00
|
|
|
/** @experimental */ static initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef): 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;
|
2016-12-15 02:05:17 +03:00
|
|
|
static overrideTemplate(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 = {
|
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[]>;
|
2016-07-29 04:19:02 -07:00
|
|
|
};
|
2016-07-04 09:37:30 -07:00
|
|
|
|
2016-06-27 12:27:23 -07:00
|
|
|
/** @experimental */
|
2016-07-29 04:19:02 -07:00
|
|
|
export declare function tick(millis?: number): void;
|
|
|
|
|
|
|
|
|
|
/** @experimental */
|
|
|
|
|
export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
|