UNPKG

histoire

Version:

A fast story book powered by Vite

25 lines • 1.14 kB
import type { Context } from '../context.js'; import type { PreviewRuntimeStoryFile } from './preview-runtime/preamble.js'; /** Options of {@link buildTestHarnessSource}. */ export interface TestHarnessOptions { /** Resolved id of the variant test session module. */ variantTestSessionId: string; /** Story metadata baked into the harness at transform time. */ files: PreviewRuntimeStoryFile[]; /** Maximum time allowed for one variant mount. */ mountTimeoutMs: number; } /** * Emits the browser test harness module: the story metadata plus one dynamic * module loader per story file, wrapped in a variant test session. * * Kept free of module resolution (which needs a real install layout) so the * generated source can be exercised on its own. */ export declare function buildTestHarnessSource({ variantTestSessionId, files, mountTimeoutMs }: TestHarnessOptions): string; /** * Virtual module factory for `virtual:$histoire-test-harness`. * @param ctx Histoire context holding the collected story files. */ export declare function testHarness(ctx: Context): string; //# sourceMappingURL=test-harness.d.ts.map