import { DebugElement, InjectionToken, Type } from '@angular/core'; import { ComponentFixture, TestModuleMetadata } from '@angular/core/testing'; export declare class EasyTest { fixture: ComponentFixture; debugElement: DebugElement; component: T; element: HTMLElement | any; /** * Wrapper for TestBed.get() */ get(type: Type | InjectionToken): any; /** * Run detect changes on the host component */ detectChanges(): void; /** * Query a DOM element from the tested element * @param selector * @returns {any} */ query(selector: string): any; /** * Query a DOM elements from the tested element * @param selector * @returns {any} */ queryAll(selector: string): any; /** * * @param input * @param inputValue */ whenInput(input: Partial | string, inputValue?: any): void; /** * * @param output * @param cb */ whenOutput(output: string, cb: (result: T) => any): void; /** * Trigger event on the element via DebugElement.triggerEventHandler() * @param event * @param selector * @param eventObj */ trigger(event: string, selector: string | DebugElement, eventObj?: any): void; /** * Dispatch custom DOM event the old fashioned way * @param {HTMLElement} element * @param {string} eventName */ dispatchCustomEvent(element: HTMLElement, eventName: string): void; /** Wait a tick then detect changes */ advance(): void; } export declare class EasyTestWithHost extends EasyTest { hostComponent: H; hostFixture: ComponentFixture; hostElement: HTMLElement; testedDe: DebugElement; /** * Run detect changes on the host component */ detectChangesHost(): void; } /** * Create factory-function for tested component * @param component - testedType * @param shallow - use NO_ERRORS_SCHEMA * @param moduleMetadata */ export declare function makeTestComponentFactory({component, shallow, ...moduleMetadata}: TestModuleMetadata & { component: Type; shallow?: boolean; }): (componentParameters?: Partial, detectChanges?: boolean) => EasyTest; export declare class HostComponent { } export declare function makeHostComponentFactory({tested, host, ...moduleMetadata}: TestModuleMetadata & { tested: Type; host?: Type; }): (template: string, styles?: any) => EasyTestWithHost; export interface EasyTestService { service: S; } /** * * @param service * @param mocks * @param moduleMetadata */ export declare function createServiceFixture({service, mocks, ...moduleMetadata}: TestModuleMetadata & { service: Type; mocks?: Type[]; }): EasyTestService;