import { type App, type AppOptions, type DynamicModule, type ModuleRef, type Registration } from '@dunx/core'; export interface TestAppOptions extends AppOptions { /** * The graph under test. A single module, or several - they become the `imports` * of one synthetic root, so no fixture module has to be written by hand. */ readonly modules: ModuleRef | readonly ModuleRef[]; } /** * The root `createTestApp` boots. Exported for the case the harness deliberately * does not cover: configuring an `HttpApp` before `listen()` (`enableCors`, `use`, * `set`), which means calling `HttpFactory.create(testRoot(modules), …)` directly. */ export declare const testRoot: (modules: ModuleRef | readonly ModuleRef[]) => DynamicModule; /** The caller's overrides, behind the harness's own. */ export declare const appOptions: (overrides: readonly Registration[] | undefined) => AppOptions; /** * The container the app under test would have, with the bindings named in * `overrides` **replaced in place**. * * ```ts * const app = await createTestApp({ * modules: [UsersModule], * overrides: [provide(Clock, { useValue: new FixedClock('2026-01-01') })], * }); * ``` * * Replacement, not addition: the discarded provider is never instantiated, so an * async `useFactory` that would open the real database never runs. An override * naming a token nobody binds throws instead of passing silently. * * One binding is replaced without being asked for: `ReadinessOptions`, so * `HealthModule`'s shutdown drain does not run per teardown. Pass your own to * restore it. */ export declare const createTestApp: (options: TestAppOptions) => Promise;