| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782 |
- /**
- * @license Angular v8.1.0
- * (c) 2010-2019 Google LLC. https://angular.io/
- * License: MIT
- */
- import { ChangeDetectorRef } from '@angular/core';
- import { Compiler } from '@angular/core';
- import { CompilerOptions } from '@angular/core';
- import { Component } from '@angular/core';
- import { ComponentFactory } 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 { Injector } from '@angular/core';
- import { NgModule } from '@angular/core';
- import { NgZone } from '@angular/core';
- import { Pipe } from '@angular/core';
- import { PlatformRef } from '@angular/core';
- import { SchemaMetadata } from '@angular/core';
- import { Type } from '@angular/core';
- export declare const __core_private_testing_placeholder__ = "";
- /**
- * Wraps a test function in an asynchronous test zone. The test will automatically
- * complete when all asynchronous calls within this zone are done. Can be used
- * to wrap an {@link inject} call.
- *
- * Example:
- *
- * ```
- * it('...', async(inject([AClass], (object) => {
- * object.doSomething.then(() => {
- * expect(...);
- * })
- * });
- * ```
- *
- * @publicApi
- */
- export declare function async(fn: Function): (done: any) => any;
- /**
- * Fixture for debugging and testing a component.
- *
- * @publicApi
- */
- export declare class ComponentFixture<T> {
- componentRef: ComponentRef<T>;
- ngZone: NgZone | null;
- private _autoDetect;
- /**
- * The DebugElement associated with the root element of this component.
- */
- debugElement: DebugElement;
- /**
- * The instance of the root component class.
- */
- componentInstance: T;
- /**
- * The native element at the root of the component.
- */
- nativeElement: any;
- /**
- * The ElementRef for the element at the root of the component.
- */
- elementRef: ElementRef;
- /**
- * The ChangeDetectorRef for the component
- */
- changeDetectorRef: ChangeDetectorRef;
- private _renderer;
- private _isStable;
- private _isDestroyed;
- private _resolve;
- private _promise;
- private _onUnstableSubscription;
- private _onStableSubscription;
- private _onMicrotaskEmptySubscription;
- private _onErrorSubscription;
- constructor(componentRef: ComponentRef<T>, ngZone: NgZone | null, _autoDetect: boolean);
- private _tick;
- /**
- * Trigger a change detection cycle for the component.
- */
- detectChanges(checkNoChanges?: boolean): void;
- /**
- * Do a change detection run to make sure there were no changes.
- */
- checkNoChanges(): void;
- /**
- * Set whether the fixture should autodetect changes.
- *
- * Also runs detectChanges once so that any existing change is detected.
- */
- autoDetectChanges(autoDetect?: boolean): void;
- /**
- * Return whether the fixture is currently stable or has async tasks that have not been completed
- * yet.
- */
- isStable(): boolean;
- /**
- * Get a promise that resolves when the fixture is stable.
- *
- * This can be used to resume testing after events have triggered asynchronous activity or
- * asynchronous change detection.
- */
- whenStable(): Promise<any>;
- private _getRenderer;
- /**
- * Get a promise that resolves when the ui state is stable following animations.
- */
- whenRenderingDone(): Promise<any>;
- /**
- * Trigger component destruction.
- */
- destroy(): void;
- }
- /**
- * @publicApi
- */
- export declare const ComponentFixtureAutoDetect: InjectionToken<boolean[]>;
- /**
- * @publicApi
- */
- export declare const ComponentFixtureNoNgZone: InjectionToken<boolean[]>;
- /**
- * Discard all remaining periodic tasks.
- *
- * @publicApi
- */
- export declare function discardPeriodicTasks(): void;
- /**
- * Wraps a function to be executed in the fakeAsync zone:
- * - microtasks are manually executed by calling `flushMicrotasks()`,
- * - timers are synchronous, `tick()` simulates the asynchronous passage of time.
- *
- * If there are any pending timers at the end of the function, an exception will be thrown.
- *
- * Can be used to wrap inject() calls.
- *
- * @usageNotes
- * ### Example
- *
- * {@example core/testing/ts/fake_async.ts region='basic'}
- *
- * @param fn
- * @returns The function wrapped to be executed in the fakeAsync zone
- *
- * @publicApi
- */
- export declare function fakeAsync(fn: Function): (...args: any[]) => any;
- /**
- * Simulates the asynchronous passage of time for the timers in the fakeAsync zone by
- * draining the macrotask queue until it is empty. The returned value is the milliseconds
- * of time that would have been elapsed.
- *
- * @param maxTurns
- * @returns The simulated time elapsed, in millis.
- *
- * @publicApi
- */
- export declare function flush(maxTurns?: number): number;
- /**
- * Flush any pending microtasks.
- *
- * @publicApi
- */
- export declare function flushMicrotasks(): void;
- /**
- * Returns a singleton of the applicable `TestBed`.
- *
- * It will be either an instance of `TestBedViewEngine` or `TestBedRender3`.
- *
- * @publicApi
- */
- export declare const getTestBed: () => TestBed;
- /**
- * Allows injecting dependencies in `beforeEach()` and `it()`.
- *
- * Example:
- *
- * ```
- * beforeEach(inject([Dependency, AClass], (dep, object) => {
- * // some code that uses `dep` and `object`
- * // ...
- * }));
- *
- * it('...', inject([AClass], (object) => {
- * object.doSomething();
- * expect(...);
- * })
- * ```
- *
- * Notes:
- * - inject is currently a function because of some Traceur limitation the syntax should
- * eventually
- * becomes `it('...', @Inject (object: AClass, async: AsyncTestCompleter) => { ... });`
- *
- * @publicApi
- */
- export declare function inject(tokens: any[], fn: Function): () => any;
- /**
- * @publicApi
- */
- export declare class InjectSetupWrapper {
- private _moduleDef;
- constructor(_moduleDef: () => TestModuleMetadata);
- private _addModule;
- inject(tokens: any[], fn: Function): () => any;
- }
- /**
- * Type used for modifications to metadata
- *
- * @publicApi
- */
- export declare type MetadataOverride<T> = {
- add?: Partial<T>;
- remove?: Partial<T>;
- set?: Partial<T>;
- };
- /**
- * Clears out the shared fake async zone for a test.
- * To be called in a global `beforeEach`.
- *
- * @publicApi
- */
- export declare function resetFakeAsyncZone(): void;
- /**
- * @publicApi
- */
- export declare interface TestBed {
- platform: PlatformRef;
- ngModule: Type<any> | Type<any>[];
- /**
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
- * angular module. These are common to every test in the suite.
- *
- * This may only be called once, to set up the common providers for the current test
- * suite on the current platform. If you absolutely need to change the providers,
- * first use `resetTestEnvironment`.
- *
- * Test modules and platforms for individual platforms are available from
- * '@angular/<platform_name>/testing'.
- */
- initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
- /**
- * Reset the providers for the test injector.
- */
- resetTestEnvironment(): void;
- resetTestingModule(): void;
- configureCompiler(config: {
- providers?: any[];
- useJit?: boolean;
- }): void;
- configureTestingModule(moduleDef: TestModuleMetadata): void;
- compileComponents(): Promise<any>;
- get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
- /**
- * deprecated from v8.0.0 use Type<T> or InjectionToken<T>
- * This does not use the deprecated jsdoc tag on purpose
- * because it renders all overloads as deprecated in TSLint
- * due to https://github.com/palantir/tslint/issues/4522.
- */
- get(token: any, notFoundValue?: any): any;
- execute(tokens: any[], fn: Function, context?: any): any;
- overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void;
- overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;
- overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;
- overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void;
- /**
- * Overwrites all providers for the given token with the given provider definition.
- */
- overrideProvider(token: any, provider: {
- useFactory: Function;
- deps: any[];
- }): void;
- overrideProvider(token: any, provider: {
- useValue: any;
- }): void;
- overrideProvider(token: any, provider: {
- useFactory?: Function;
- useValue?: any;
- deps?: any[];
- }): void;
- overrideTemplateUsingTestingModule(component: Type<any>, template: string): void;
- createComponent<T>(component: Type<T>): ComponentFixture<T>;
- }
- /**
- * @description
- * Configures and initializes environment for unit testing and provides methods for
- * creating components and services in unit tests.
- *
- * `TestBed` is the primary api for writing unit tests for Angular applications and libraries.
- *
- * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3`
- * according to the compiler used.
- *
- * @publicApi
- */
- export declare const TestBed: TestBedStatic;
- /**
- * Static methods implemented by the `TestBedViewEngine` and `TestBedRender3`
- *
- * @publicApi
- */
- export declare interface TestBedStatic {
- new (...args: any[]): TestBed;
- initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed;
- /**
- * Reset the providers for the test injector.
- */
- resetTestEnvironment(): void;
- resetTestingModule(): TestBedStatic;
- /**
- * Allows overriding default compiler providers and settings
- * which are defined in test_injector.js
- */
- configureCompiler(config: {
- providers?: any[];
- useJit?: boolean;
- }): TestBedStatic;
- /**
- * Allows overriding default providers, directives, pipes, modules of the test injector,
- * which are defined in test_injector.js
- */
- configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic;
- /**
- * Compile components with a `templateUrl` for the test's NgModule.
- * It is necessary to call this function
- * as fetching urls is asynchronous.
- */
- compileComponents(): Promise<any>;
- overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic;
- overrideComponent(component: Type<any>, override: MetadataOverride<Component>): TestBedStatic;
- overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): TestBedStatic;
- overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic;
- overrideTemplate(component: Type<any>, template: string): TestBedStatic;
- /**
- * Overrides the template of the given component, compiling the template
- * in the context of the TestingModule.
- *
- * Note: This works for JIT and AOTed components as well.
- */
- overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic;
- /**
- * Overwrites all providers for the given token with the given provider definition.
- *
- * Note: This works for JIT and AOTed components as well.
- */
- overrideProvider(token: any, provider: {
- useFactory: Function;
- deps: any[];
- }): TestBedStatic;
- overrideProvider(token: any, provider: {
- useValue: any;
- }): TestBedStatic;
- overrideProvider(token: any, provider: {
- useFactory?: Function;
- useValue?: any;
- deps?: any[];
- }): TestBedStatic;
- get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
- /**
- * deprecated from v8.0.0 use Type<T> or InjectionToken<T>
- * This does not use the deprecated jsdoc tag on purpose
- * because it renders all overloads as deprecated in TSLint
- * due to https://github.com/palantir/tslint/issues/4522.
- */
- get(token: any, notFoundValue?: any): any;
- createComponent<T>(component: Type<T>): ComponentFixture<T>;
- }
- /**
- * An abstract class for inserting the root test component element in a platform independent way.
- *
- * @publicApi
- */
- export declare class TestComponentRenderer {
- insertRootElement(rootElementId: string): void;
- }
- /**
- * @publicApi
- */
- export declare type TestModuleMetadata = {
- providers?: any[];
- declarations?: any[];
- imports?: any[];
- schemas?: Array<SchemaMetadata | any[]>;
- aotSummaries?: () => any[];
- };
- /**
- * Simulates the asynchronous passage of time for the timers in the fakeAsync zone.
- *
- * The microtasks queue is drained at the very start of this function and after any timer callback
- * has been executed.
- *
- * @usageNotes
- * ### Example
- *
- * {@example core/testing/ts/fake_async.ts region='basic'}
- *
- * @publicApi
- */
- export declare function tick(millis?: number): void;
- /**
- * @publicApi
- */
- export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWrapper;
- export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;
- /**
- * @description
- * Configures and initializes environment for unit testing and provides methods for
- * creating components and services in unit tests.
- *
- * `TestBed` is the primary api for writing unit tests for Angular applications and libraries.
- *
- * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3`
- * according to the compiler used.
- */
- export declare class ɵangular_packages_core_testing_testing_a implements Injector, TestBed {
- /**
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
- * angular module. These are common to every test in the suite.
- *
- * This may only be called once, to set up the common providers for the current test
- * suite on the current platform. If you absolutely need to change the providers,
- * first use `resetTestEnvironment`.
- *
- * Test modules and platforms for individual platforms are available from
- * '@angular/<platform_name>/testing'.
- */
- static initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): ɵangular_packages_core_testing_testing_a;
- /**
- * Reset the providers for the test injector.
- */
- static resetTestEnvironment(): void;
- static resetTestingModule(): TestBedStatic;
- /**
- * Allows overriding default compiler providers and settings
- * which are defined in test_injector.js
- */
- static configureCompiler(config: {
- providers?: any[];
- useJit?: boolean;
- }): TestBedStatic;
- /**
- * Allows overriding default providers, directives, pipes, modules of the test injector,
- * which are defined in test_injector.js
- */
- static configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic;
- /**
- * Compile components with a `templateUrl` for the test's NgModule.
- * It is necessary to call this function
- * as fetching urls is asynchronous.
- */
- static compileComponents(): Promise<any>;
- static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic;
- static overrideComponent(component: Type<any>, override: MetadataOverride<Component>): TestBedStatic;
- static overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): TestBedStatic;
- static overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic;
- static overrideTemplate(component: Type<any>, template: string): TestBedStatic;
- /**
- * Overrides the template of the given component, compiling the template
- * in the context of the TestingModule.
- *
- * Note: This works for JIT and AOTed components as well.
- */
- static overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic;
- /**
- * Overwrites all providers for the given token with the given provider definition.
- *
- * Note: This works for JIT and AOTed components as well.
- */
- static overrideProvider(token: any, provider: {
- useFactory: Function;
- deps: any[];
- }): TestBedStatic;
- static overrideProvider(token: any, provider: {
- useValue: any;
- }): TestBedStatic;
- static get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
- /**
- * @deprecated from v8.0.0 use Type<T> or InjectionToken<T>
- * @suppress {duplicate}
- */
- static get(token: any, notFoundValue?: any): any;
- static createComponent<T>(component: Type<T>): ComponentFixture<T>;
- private _instantiated;
- private _compiler;
- private _moduleRef;
- private _moduleFactory;
- private _compilerOptions;
- private _moduleOverrides;
- private _componentOverrides;
- private _directiveOverrides;
- private _pipeOverrides;
- private _providers;
- private _declarations;
- private _imports;
- private _schemas;
- private _activeFixtures;
- private _testEnvAotSummaries;
- private _aotSummaries;
- private _templateOverrides;
- private _isRoot;
- private _rootProviderOverrides;
- platform: PlatformRef;
- ngModule: Type<any> | Type<any>[];
- /**
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
- * angular module. These are common to every test in the suite.
- *
- * This may only be called once, to set up the common providers for the current test
- * suite on the current platform. If you absolutely need to change the providers,
- * first use `resetTestEnvironment`.
- *
- * Test modules and platforms for individual platforms are available from
- * '@angular/<platform_name>/testing'.
- */
- initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
- /**
- * Reset the providers for the test injector.
- */
- resetTestEnvironment(): void;
- resetTestingModule(): void;
- configureCompiler(config: {
- providers?: any[];
- useJit?: boolean;
- }): void;
- configureTestingModule(moduleDef: TestModuleMetadata): void;
- compileComponents(): Promise<any>;
- private _initIfNeeded;
- private _createCompilerAndModule;
- private _assertNotInstantiated;
- get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
- /**
- * @deprecated from v8.0.0 use Type<T> or InjectionToken<T>
- */
- get(token: any, notFoundValue?: any): any;
- execute(tokens: any[], fn: Function, context?: any): any;
- overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void;
- overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;
- overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;
- overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void;
- /**
- * Overwrites all providers for the given token with the given provider definition.
- */
- overrideProvider(token: any, provider: {
- useFactory: Function;
- deps: any[];
- }): void;
- overrideProvider(token: any, provider: {
- useValue: any;
- }): void;
- private overrideProviderImpl;
- overrideTemplateUsingTestingModule(component: Type<any>, template: string): void;
- createComponent<T>(component: Type<T>): ComponentFixture<T>;
- }
- /**
- * @description
- * Configures and initializes environment for unit testing and provides methods for
- * creating components and services in unit tests.
- *
- * TestBed is the primary api for writing unit tests for Angular applications and libraries.
- *
- * Note: Use `TestBed` in tests. It will be set to either `TestBedViewEngine` or `TestBedRender3`
- * according to the compiler used.
- */
- export declare class ɵangular_packages_core_testing_testing_b implements Injector, TestBed {
- /**
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
- * angular module. These are common to every test in the suite.
- *
- * This may only be called once, to set up the common providers for the current test
- * suite on the current platform. If you absolutely need to change the providers,
- * first use `resetTestEnvironment`.
- *
- * Test modules and platforms for individual platforms are available from
- * '@angular/<platform_name>/testing'.
- *
- * @publicApi
- */
- static initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): TestBed;
- /**
- * Reset the providers for the test injector.
- *
- * @publicApi
- */
- static resetTestEnvironment(): void;
- static configureCompiler(config: {
- providers?: any[];
- useJit?: boolean;
- }): TestBedStatic;
- /**
- * Allows overriding default providers, directives, pipes, modules of the test injector,
- * which are defined in test_injector.js
- */
- static configureTestingModule(moduleDef: TestModuleMetadata): TestBedStatic;
- /**
- * Compile components with a `templateUrl` for the test's NgModule.
- * It is necessary to call this function
- * as fetching urls is asynchronous.
- */
- static compileComponents(): Promise<any>;
- static overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): TestBedStatic;
- static overrideComponent(component: Type<any>, override: MetadataOverride<Component>): TestBedStatic;
- static overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): TestBedStatic;
- static overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): TestBedStatic;
- static overrideTemplate(component: Type<any>, template: string): TestBedStatic;
- /**
- * Overrides the template of the given component, compiling the template
- * in the context of the TestingModule.
- *
- * Note: This works for JIT and AOTed components as well.
- */
- static overrideTemplateUsingTestingModule(component: Type<any>, template: string): TestBedStatic;
- static overrideProvider(token: any, provider: {
- useFactory: Function;
- deps: any[];
- }): TestBedStatic;
- static overrideProvider(token: any, provider: {
- useValue: any;
- }): TestBedStatic;
- static get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
- /**
- * @deprecated from v8.0.0 use Type<T> or InjectionToken<T>
- */
- static get(token: any, notFoundValue?: any): any;
- static createComponent<T>(component: Type<T>): ComponentFixture<T>;
- static resetTestingModule(): TestBedStatic;
- platform: PlatformRef;
- ngModule: Type<any> | Type<any>[];
- private _compiler;
- private _testModuleRef;
- private _activeFixtures;
- private _globalCompilationChecked;
- /**
- * Initialize the environment for testing with a compiler factory, a PlatformRef, and an
- * angular module. These are common to every test in the suite.
- *
- * This may only be called once, to set up the common providers for the current test
- * suite on the current platform. If you absolutely need to change the providers,
- * first use `resetTestEnvironment`.
- *
- * Test modules and platforms for individual platforms are available from
- * '@angular/<platform_name>/testing'.
- *
- * @publicApi
- */
- initTestEnvironment(ngModule: Type<any> | Type<any>[], platform: PlatformRef, aotSummaries?: () => any[]): void;
- /**
- * Reset the providers for the test injector.
- *
- * @publicApi
- */
- resetTestEnvironment(): void;
- resetTestingModule(): void;
- configureCompiler(config: {
- providers?: any[];
- useJit?: boolean;
- }): void;
- configureTestingModule(moduleDef: TestModuleMetadata): void;
- compileComponents(): Promise<any>;
- get<T>(token: Type<T> | InjectionToken<T>, notFoundValue?: T, flags?: InjectFlags): any;
- /**
- * @deprecated from v8.0.0 use Type<T> or InjectionToken<T>
- */
- get(token: any, notFoundValue?: any): any;
- execute(tokens: any[], fn: Function, context?: any): any;
- overrideModule(ngModule: Type<any>, override: MetadataOverride<NgModule>): void;
- overrideComponent(component: Type<any>, override: MetadataOverride<Component>): void;
- overrideTemplateUsingTestingModule(component: Type<any>, template: string): void;
- overrideDirective(directive: Type<any>, override: MetadataOverride<Directive>): void;
- overridePipe(pipe: Type<any>, override: MetadataOverride<Pipe>): void;
- /**
- * Overwrites all providers for the given token with the given provider definition.
- */
- overrideProvider(token: any, provider: {
- useFactory?: Function;
- useValue?: any;
- deps?: any[];
- }): void;
- createComponent<T>(type: Type<T>): ComponentFixture<T>;
- private readonly compiler;
- private readonly testModuleRef;
- private assertNotInstantiated;
- /**
- * Check whether the module scoping queue should be flushed, and flush it if needed.
- *
- * When the TestBed is reset, it clears the JIT module compilation queue, cancelling any
- * in-progress module compilation. This creates a potential hazard - the very first time the
- * TestBed is initialized (or if it's reset without being initialized), there may be pending
- * compilations of modules declared in global scope. These compilations should be finished.
- *
- * To ensure that globally declared modules have their components scoped properly, this function
- * is called whenever TestBed is initialized or reset. The _first_ time that this happens, prior
- * to any other operations, the scoping queue is flushed.
- */
- private checkGlobalCompilationFinished;
- private destroyActiveFixtures;
- }
- export declare function ɵangular_packages_core_testing_testing_c(): ɵangular_packages_core_testing_testing_b;
- export declare class ɵMetadataOverrider {
- private _references;
- /**
- * Creates a new instance for the given metadata class
- * based on an old instance and overrides.
- */
- overrideMetadata<C extends T, T>(metadataClass: {
- new (options: T): C;
- }, oldMetadata: C, override: MetadataOverride<T>): C;
- }
- /**
- * Special interface to the compiler only used by testing
- *
- * @publicApi
- */
- export declare class ɵTestingCompiler extends Compiler {
- readonly injector: Injector;
- overrideModule(module: Type<any>, overrides: MetadataOverride<NgModule>): void;
- overrideDirective(directive: Type<any>, overrides: MetadataOverride<Directive>): void;
- overrideComponent(component: Type<any>, overrides: MetadataOverride<Component>): void;
- overridePipe(directive: Type<any>, overrides: MetadataOverride<Pipe>): void;
- /**
- * Allows to pass the compile summary from AOT compilation to the JIT compiler,
- * so that it can use the code generated by AOT.
- */
- loadAotSummaries(summaries: () => any[]): void;
- /**
- * Gets the component factory for the given component.
- * This assumes that the component has been compiled before calling this call using
- * `compileModuleAndAllComponents*`.
- */
- getComponentFactory<T>(component: Type<T>): ComponentFactory<T>;
- /**
- * Returns the component type that is stored in the given error.
- * This can be used for errors created by compileModule...
- */
- getComponentFromError(error: Error): Type<any> | null;
- }
- /**
- * A factory for creating a Compiler
- *
- * @publicApi
- */
- export declare abstract class ɵTestingCompilerFactory {
- abstract createTestingCompiler(options?: CompilerOptions[]): ɵTestingCompiler;
- }
- export { }
|