histoire
Version:
A fast story book powered by Vite
29 lines • 1.23 kB
TypeScript
/** Identifies the story facade on the iframe and marks Histoire-owned test tasks. */
export declare const STORY_EXPECT_SYMBOL = "histoire:story-expect";
export declare const STORY_EXPECT_KEY: unique symbol;
/** Reads the shared expect object installed by Vitest (or the preview shim). */
export declare function getSharedExpect(): any;
/**
* Resets the global expect bookkeeping (`assertionCalls`, `expect.assertions(n)`,
* `expect.hasAssertions()`) so they don't leak between consecutive test handlers
* inside the same iframe runtime.
*/
export declare function resetSharedExpectState(): void;
/**
* Mirrors Vitest's end-of-test assertion bookkeeping checks for the lightweight
* preview expect shim.
*/
export declare function assertSharedExpectState(context?: {
_local?: boolean;
expect?: any;
}): void;
/**
* Completes Vitest's body assertion check before teardown hooks can make more
* assertions. The real runner performs this check before `afterEach`; clearing
* the expectation also prevents its outer generated test from checking again.
*/
export declare function assertAndClearSharedExpectState(context?: {
_local?: boolean;
expect?: any;
}): void;
//# sourceMappingURL=expect-state.d.ts.map