2021-06-28 19:54:20 +02:00
|
|
|
## API Report File for "@angular/core_testing"
|
2020-07-28 11:54:11 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
```ts
|
|
|
|
|
|
|
|
|
|
import { ChangeDetectorRef } from '@angular/core';
|
|
|
|
|
import { Component } from '@angular/core';
|
|
|
|
|
import { ComponentRef } from '@angular/core';
|
|
|
|
|
import { DebugElement } from '@angular/core';
|
|
|
|
|
import { Directive } from '@angular/core';
|
|
|
|
|
import { ElementRef } from '@angular/core';
|
|
|
|
|
import { InjectFlags } from '@angular/core';
|
|
|
|
|
import { InjectionToken } from '@angular/core';
|
|
|
|
|
import { NgModule } from '@angular/core';
|
|
|
|
|
import { NgZone } from '@angular/core';
|
|
|
|
|
import { Pipe } from '@angular/core';
|
|
|
|
|
import { PlatformRef } from '@angular/core';
|
|
|
|
|
import { ProviderToken } from '@angular/core';
|
|
|
|
|
import { SchemaMetadata } from '@angular/core';
|
|
|
|
|
import { Type } from '@angular/core';
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export const __core_private_testing_placeholder__ = "";
|
|
|
|
|
|
|
|
|
|
// @public @deprecated (undocumented)
|
|
|
|
|
export function async(fn: Function): (done: any) => any;
|
|
|
|
|
|
|
|
|
|
// @public
|
|
|
|
|
export class ComponentFixture<T> {
|
|
|
|
|
constructor(componentRef: ComponentRef<T>, ngZone: NgZone | null, _autoDetect: boolean);
|
|
|
|
|
autoDetectChanges(autoDetect?: boolean): void;
|
2016-06-24 12:41:49 -07:00
|
|
|
changeDetectorRef: ChangeDetectorRef;
|
2021-06-28 19:54:20 +02:00
|
|
|
checkNoChanges(): void;
|
2016-06-30 13:07:17 -07:00
|
|
|
componentInstance: T;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-06-24 12:41:49 -07:00
|
|
|
componentRef: ComponentRef<T>;
|
|
|
|
|
debugElement: DebugElement;
|
|
|
|
|
destroy(): void;
|
|
|
|
|
detectChanges(checkNoChanges?: boolean): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
elementRef: ElementRef;
|
2016-06-24 12:41:49 -07:00
|
|
|
isStable(): boolean;
|
2021-06-28 19:54:20 +02:00
|
|
|
nativeElement: any;
|
|
|
|
|
// (undocumented)
|
|
|
|
|
ngZone: NgZone | null;
|
2017-05-12 16:49:16 -04:00
|
|
|
whenRenderingDone(): Promise<any>;
|
2016-06-24 12:41:49 -07:00
|
|
|
whenStable(): Promise<any>;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public (undocumented)
|
|
|
|
|
export const ComponentFixtureAutoDetect: InjectionToken<boolean[]>;
|
2016-06-24 17:35:01 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public (undocumented)
|
|
|
|
|
export const ComponentFixtureNoNgZone: InjectionToken<boolean[]>;
|
2016-06-24 17:35:01 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export function discardPeriodicTasks(): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export function fakeAsync(fn: Function): (...args: any[]) => any;
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export function flush(maxTurns?: number): number;
|
2017-05-22 11:19:21 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export function flushMicrotasks(): void;
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export const getTestBed: () => TestBed;
|
2016-07-20 10:51:21 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export function inject(tokens: any[], fn: Function): () => any;
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public (undocumented)
|
|
|
|
|
export class InjectSetupWrapper {
|
2016-07-29 04:19:02 -07:00
|
|
|
constructor(_moduleDef: () => TestModuleMetadata);
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2016-06-24 17:48:35 -07:00
|
|
|
inject(tokens: any[], fn: Function): () => any;
|
2021-06-28 19:54:20 +02:00
|
|
|
}
|
2016-06-22 14:56:10 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export 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
|
|
|
};
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface ModuleTeardownOptions {
|
2021-06-13 10:32:57 +02:00
|
|
|
destroyAfterEach: boolean;
|
|
|
|
|
rethrowErrors?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export function resetFakeAsyncZone(): void;
|
2016-08-02 07:54:14 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public (undocumented)
|
|
|
|
|
export interface TestBed {
|
|
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
compileComponents(): Promise<any>;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
configureCompiler(config: {
|
|
|
|
|
providers?: any[];
|
|
|
|
|
useJit?: boolean;
|
|
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
configureTestingModule(moduleDef: TestModuleMetadata): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
createComponent<T>(component: Type<T>): ComponentFixture<T>;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
execute(tokens: any[], fn: Function, context?: any): any;
|
2021-06-28 19:54:20 +02:00
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
|
|
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
get(token: any, notFoundValue?: any): any;
|
2021-06-13 10:32:57 +02:00
|
|
|
initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, options?: TestEnvironmentOptions): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2021-04-12 17:32:10 +02:00
|
|
|
inject<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2021-04-12 17:32:10 +02:00
|
|
|
inject<T>(token: ProviderToken<T>, notFoundValue: null, flags?: InjectFlags): T | null;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
ngModule: Type<any> | Type<any>[];
|
|
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void;
|
|
|
|
|
overrideProvider(token: any, provider: {
|
2019-05-20 16:08:16 -07:00
|
|
|
useFactory: Function;
|
|
|
|
|
deps: any[];
|
2018-11-26 14:44:45 -08:00
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
overrideProvider(token: any, provider: {
|
2019-04-03 10:23:46 -07:00
|
|
|
useValue: any;
|
2018-11-26 14:44:45 -08:00
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
overrideProvider(token: any, provider: {
|
2019-05-20 16:08:16 -07:00
|
|
|
useFactory?: Function;
|
|
|
|
|
useValue?: any;
|
|
|
|
|
deps?: any[];
|
2018-11-26 14:44:45 -08:00
|
|
|
}): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
overrideTemplateUsingTestingModule(component: Type<any>, template: string): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
|
|
|
|
platform: PlatformRef;
|
2018-11-26 14:44:45 -08:00
|
|
|
resetTestEnvironment(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-11-26 14:44:45 -08:00
|
|
|
resetTestingModule(): void;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export const TestBed: TestBedStatic;
|
2018-08-06 14:09:38 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export interface TestBedStatic {
|
|
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
new (...args: any[]): TestBed;
|
2018-08-06 14:09:38 -07:00
|
|
|
compileComponents(): Promise<any>;
|
|
|
|
|
configureCompiler(config: {
|
|
|
|
|
providers?: any[];
|
|
|
|
|
useJit?: boolean;
|
2018-08-14 16:27:04 -07:00
|
|
|
}): TestBedStatic;
|
|
|
|
|
configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
createComponent<T>(component: Type<T>): ComponentFixture<T>;
|
2021-06-28 19:54:20 +02:00
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
get<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
|
|
|
|
|
// @deprecated (undocumented)
|
|
|
|
|
get(token: any, notFoundValue?: any): any;
|
|
|
|
|
// (undocumented)
|
2021-06-13 10:32:57 +02:00
|
|
|
initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, options?: {
|
|
|
|
|
teardown?: ModuleTeardownOptions;
|
|
|
|
|
}): TestBed;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2021-04-12 17:32:10 +02:00
|
|
|
inject<T>(token: ProviderToken<T>, notFoundValue?: T, flags?: InjectFlags): T;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2021-04-12 17:32:10 +02:00
|
|
|
inject<T>(token: ProviderToken<T>, notFoundValue: null, flags?: InjectFlags): T | null;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
overrideComponent(component: Type<any>, override: MetadataOverride<Component>): TestBedStatic;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): TestBedStatic;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic;
|
2020-01-24 10:55:39 -08:00
|
|
|
overrideProvider(token: any, provider: {
|
|
|
|
|
useFactory: Function;
|
|
|
|
|
deps: any[];
|
|
|
|
|
}): TestBedStatic;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
overrideProvider(token: any, provider: {
|
|
|
|
|
useValue: any;
|
|
|
|
|
}): TestBedStatic;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-06 14:09:38 -07:00
|
|
|
overrideProvider(token: any, provider: {
|
|
|
|
|
useFactory?: Function;
|
|
|
|
|
useValue?: any;
|
|
|
|
|
deps?: any[];
|
2018-08-14 16:27:04 -07:00
|
|
|
}): TestBedStatic;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
overrideTemplate(component: Type<any>, template: string): TestBedStatic;
|
|
|
|
|
overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic;
|
2018-10-19 16:27:04 +01:00
|
|
|
resetTestEnvironment(): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2018-08-14 16:27:04 -07:00
|
|
|
resetTestingModule(): TestBedStatic;
|
2016-07-20 10:51:21 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export class TestComponentRenderer {
|
|
|
|
|
// (undocumented)
|
2016-06-24 17:35:01 -07:00
|
|
|
insertRootElement(rootElementId: string): void;
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2021-06-13 10:32:57 +02:00
|
|
|
removeAllRootElements?(): void;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public (undocumented)
|
|
|
|
|
export interface TestEnvironmentOptions {
|
|
|
|
|
// (undocumented)
|
2021-06-13 10:32:57 +02:00
|
|
|
aotSummaries?: () => any[];
|
2021-06-28 19:54:20 +02:00
|
|
|
// (undocumented)
|
2021-06-13 10:32:57 +02:00
|
|
|
teardown?: ModuleTeardownOptions;
|
2016-06-24 17:35:01 -07:00
|
|
|
}
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public (undocumented)
|
|
|
|
|
export 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[]>;
|
2017-10-27 17:04:11 -07:00
|
|
|
aotSummaries?: () => any[];
|
2021-06-13 10:32:57 +02:00
|
|
|
teardown?: ModuleTeardownOptions;
|
2016-07-29 04:19:02 -07:00
|
|
|
};
|
|
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export function tick(millis?: number, tickOptions?: {
|
2019-12-03 00:56:56 +09:00
|
|
|
processNewMacroTasksSynchronously: boolean;
|
|
|
|
|
}): void;
|
2016-07-04 09:37:30 -07:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
// @public
|
|
|
|
|
export function waitForAsync(fn: Function): (done: any) => any;
|
|
|
|
|
|
|
|
|
|
// @public (undocumented)
|
|
|
|
|
export function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
|
|
|
|
|
|
|
|
|
|
// @public (undocumented)
|
|
|
|
|
export function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// (No @packageDocumentation comment for this package)
|
2020-08-01 04:43:18 +09:00
|
|
|
|
2021-06-28 19:54:20 +02:00
|
|
|
```
|