histoire
Version:
A fast story book powered by Vite
27 lines • 1.05 kB
TypeScript
/**
* Minimal Vitest shape used for reporting unhandled browser-run errors without
* coupling these helpers to Vitest's concrete class types.
*/
export interface VitestLike {
state?: {
getUnhandledErrors?: () => unknown[];
};
}
/**
* Extracts a readable error message from a Vitest error payload.
*
* Errors coming back from the browser are serialized plain objects, not `Error`
* instances: their stack is kept too, since it often carries the only mention of
* what actually broke (a nested cause, the failing module…).
*/
export declare function formatVitestError(error: unknown): string;
/**
* Returns all unhandled Vitest errors as printable strings.
*/
export declare function getUnhandledVitestErrors(vitest: VitestLike): string[];
/**
* Throws when the Vitest run reported unhandled errors outside individual test
* results, such as import/setup crashes in the browser runtime.
*/
export declare function assertVitestRunHasNoUnhandledErrors(vitest: VitestLike): void;
//# sourceMappingURL=vitest-errors.d.ts.map