histoire
Version:
A fast story book powered by Vite
39 lines • 1.73 kB
TypeScript
import type { TestCaseDto, TestSummaryDto } from '@histoire/cli/protocol/tests';
import type { HistoireTestRunSummary } from '@histoire/shared';
/** Bounds applied when a summary is projected for retention and transport. */
export interface ProjectionLimits {
/** Largest serialized case, in UTF-8 bytes; larger entries lose their error text. */
caseBytes: number;
/** Longest error text block, in UTF-16 units. */
errorChars: number;
/** Error blocks kept per case. */
errorsPerCase: number;
/** Total serialized bytes of retained cases. */
retainBytes: number;
/** Run-level errors kept. */
runErrors: number;
/** Uncollected stories kept. */
uncollected: number;
}
/** Frozen defaults; tests override single fields. */
export declare const DEFAULT_PROJECTION_LIMITS: ProjectionLimits;
/** Retained, pageable part of a projected run. */
export interface ProjectedResults {
/** Aggregate with exact totals and explicit omissions. */
summary: TestSummaryDto;
/** Retained cases, failures first, then original order. */
cases: TestCaseDto[];
/** Serialized bytes of `cases`, used for store budgeting. */
bytes: number;
}
/** UTF-8 size of a JSON value. */
export declare function jsonBytes(value: unknown): number;
/**
* Projects a runner summary: sanitized, bounded cases (failures first so
* truncation only ever drops passing/skipped entries) plus an aggregate whose
* totals stay exact whatever was omitted.
* @param summary Runner or merged batch summary.
* @param limits Projection bounds.
*/
export declare function projectSummary(summary: HistoireTestRunSummary, limits?: ProjectionLimits): ProjectedResults;
//# sourceMappingURL=projection.d.ts.map