histoire
Version:
A fast story book powered by Vite
29 lines • 1.18 kB
TypeScript
import type { HistoireTestDefinition } from '@histoire/shared';
import { STORY_EXPECT_KEY } from './expect-state.js';
/** Marks a real Vitest task so nested lifecycle code can identify it safely. */
export declare function enterHistoireTestTask(task: unknown): () => void;
/** Checks whether this task belongs to Histoire's embedded lifecycle. */
export declare function isHistoireTestTask(task: unknown): boolean;
/** Creates the task and shared TestContext supplied to embedded callbacks. */
export declare function createPreviewTestTask(definition: HistoireTestDefinition, id: string, filepath: string): {
id: string;
type: string;
name: string;
fullTestName: string;
file: {
filepath: string;
};
meta: {};
result: {
state: string;
errors: unknown[];
};
onFailed: ((context: any) => unknown)[];
onFinished: ((context: any) => unknown)[];
context: any;
promises: Promise<unknown>[];
[STORY_EXPECT_KEY]: boolean;
};
/** Distinguishes tasks whose errors are read directly by the preview UI. */
export declare function isPreviewTestTask(task: object): boolean;
//# sourceMappingURL=test-task.d.ts.map