import type { LitElement } from "@arcgis/lumina"; /** * Wrap a controller in a small component - useful when you are interested in * only testing the controller behavior. * * @param controller * @param afterConstruct * @example * ```ts * const testController = (): string => makeController(()=>'a'); * const { component } = await mount(wrapController(testController)); * expect(component.controller).toEqual("a"); * ``` * @example * ```ts * class TestController extends Controller { * a = "a"; * } * const { * component: { controller } * } = await mount(wrapController(TestController)); * expect(controller.a).toEqual("a"); * ``` */ export function wrapController(controller: ((component: LitElement) => T) | (new (component: LitElement) => T), afterConstruct?: (component: LitElement & { controller: T; }) => Promise | void): typeof LitElement & (new () => LitElement & { controller: T; });