executable-stories-formatters
Advanced tools
| /** | ||
| * Typed CI provider and canonical CI info. | ||
| * | ||
| * RawCIInfo.name = legacy transport string (kept for backward compat + schema). | ||
| * CIInfo.displayName = canonical display name for downstream consumers. | ||
| * | ||
| * All downstream code (HTML meta, notifications, history) uses CIInfo via mappers. | ||
| */ | ||
| type CIProvider = "github" | "gitlab" | "circleci" | "jenkins" | "azure" | "buildkite" | "travis" | "unknown"; | ||
| interface CIInfo$1 { | ||
| provider: CIProvider; | ||
| displayName: string; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| branch?: string; | ||
| commitSha?: string; | ||
| prNumber?: string; | ||
| } | ||
| /** Convert RawCIInfo (legacy transport) to canonical CIInfo. */ | ||
| declare function toCIInfo(raw?: RawCIInfo): CIInfo$1 | undefined; | ||
| /** Convert canonical CIInfo back to RawCIInfo (for serialization). */ | ||
| declare function toRawCIInfo(ci?: CIInfo$1): RawCIInfo | undefined; | ||
| /** | ||
| * OTel span types for trace waterfall rendering. | ||
| * | ||
| * Structurally compatible with autotel's SerializedSpan | ||
| * and raw OTel nanosecond formats. No import dependency on autotel. | ||
| */ | ||
| type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[]; | ||
| interface OtelSpan { | ||
| spanId: string; | ||
| parentSpanId?: string; | ||
| name: string; | ||
| /** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */ | ||
| startTimeMs?: number; | ||
| durationMs?: number; | ||
| /** Compatibility: raw OTel nanosecond timestamps */ | ||
| startTimeUnixNano?: number; | ||
| endTimeUnixNano?: number; | ||
| status: "ok" | "error" | "unset"; | ||
| statusMessage?: string; | ||
| attributes?: Record<string, OtelAttributeValue>; | ||
| } | ||
| /** | ||
| * Story types — the shared vocabulary for all framework adapters. | ||
| * | ||
| * These types were previously in executable-stories-core. | ||
| * They now live in formatters so every adapter can import them | ||
| * from the same place that defines RawRun (the output contract). | ||
| */ | ||
| /** BDD step keywords for scenario documentation */ | ||
| type StepKeyword = "Given" | "When" | "Then" | "And" | "But"; | ||
| /** Step execution mode for docs rendering */ | ||
| type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent"; | ||
| /** Phase tracks when the doc entry was added */ | ||
| type DocPhase = "static" | "runtime"; | ||
| /** Union type for all documentation entry kinds */ | ||
| type DocEntry = { | ||
| kind: "note"; | ||
| text: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "tag"; | ||
| names: string[]; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "kv"; | ||
| label: string; | ||
| value: unknown; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "code"; | ||
| label: string; | ||
| content: string; | ||
| lang?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "table"; | ||
| label: string; | ||
| columns: string[]; | ||
| rows: string[][]; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "link"; | ||
| label: string; | ||
| url: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "section"; | ||
| title: string; | ||
| markdown: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "mermaid"; | ||
| code: string; | ||
| title?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "screenshot"; | ||
| path: string; | ||
| alt?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "video"; | ||
| path: string; | ||
| caption?: string; | ||
| poster?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "custom"; | ||
| type: string; | ||
| data: unknown; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| }; | ||
| /** | ||
| * A single step in a scenario with its documentation entries. | ||
| */ | ||
| interface StoryStep { | ||
| /** Stable internal ID (auto-generated at creation, e.g., "step-0") */ | ||
| id?: string; | ||
| /** The BDD keyword (Given, When, Then, And, But) */ | ||
| keyword: StepKeyword; | ||
| /** The step description text */ | ||
| text: string; | ||
| /** Step execution mode for docs rendering */ | ||
| mode?: StepMode; | ||
| /** Rich documentation entries attached to this step */ | ||
| docs?: DocEntry[]; | ||
| /** Opt-in step duration in milliseconds */ | ||
| durationMs?: number; | ||
| /** Whether this step wrapped a function body (step.fn / step.step) vs a text marker */ | ||
| wrapped?: boolean; | ||
| } | ||
| /** A ticket reference with an optional direct URL */ | ||
| interface NormalizedTicket { | ||
| /** Ticket identifier (e.g., "JIRA-123", "PAY-1042") */ | ||
| id: string; | ||
| /** Direct URL to the ticket (overrides ticketUrlTemplate) */ | ||
| url?: string; | ||
| } | ||
| /** | ||
| * Metadata for a complete scenario, attached to test metadata. | ||
| * Used by reporters to generate documentation. | ||
| */ | ||
| interface StoryMeta { | ||
| /** The scenario title (from test name) */ | ||
| scenario: string; | ||
| /** All steps in this scenario */ | ||
| steps: StoryStep[]; | ||
| /** Tags for filtering and categorization */ | ||
| tags?: string[]; | ||
| /** Ticket/issue references (normalized to array) */ | ||
| tickets?: NormalizedTicket[]; | ||
| /** Product-code paths/globs this scenario exercises (project-root-relative). */ | ||
| covers?: string[]; | ||
| /** User-defined metadata */ | ||
| meta?: Record<string, unknown>; | ||
| /** Parent describe/suite names for hierarchical grouping */ | ||
| suitePath?: string[]; | ||
| /** Story-level docs (before any steps) */ | ||
| docs?: DocEntry[]; | ||
| /** Order in which story.init() was called (for source ordering) */ | ||
| sourceOrder?: number; | ||
| /** OTel spans from autotel for trace waterfall rendering */ | ||
| otelSpans?: OtelSpan[]; | ||
| } | ||
| /** Key used to store StoryMeta in test metadata */ | ||
| declare const STORY_META_KEY = "story"; | ||
| /** Permissive status from any framework */ | ||
| type RawStatus = "pass" | "fail" | "skip" | "todo" | "pending" | "timeout" | "interrupted" | "unknown"; | ||
| /** Raw attachment - don't decide inline vs link yet */ | ||
| interface RawAttachment { | ||
| name: string; | ||
| mediaType: string; | ||
| /** File reference (path on disk) */ | ||
| path?: string; | ||
| /** Inline content */ | ||
| body?: string; | ||
| /** Content encoding */ | ||
| encoding?: "BASE64" | "IDENTITY"; | ||
| /** Character set (default: "utf-8" when IDENTITY + text) */ | ||
| charset?: string; | ||
| /** Actual artifact name (distinct from logical label) */ | ||
| fileName?: string; | ||
| /** Size in bytes (for embed vs link decision) */ | ||
| byteLength?: number; | ||
| /** Step index (undefined = test-case level) */ | ||
| stepIndex?: number; | ||
| /** Stable step ID, preferred over stepIndex by converter */ | ||
| stepId?: string; | ||
| } | ||
| /** Raw step event from framework (if available) */ | ||
| interface RawStepEvent { | ||
| index?: number; | ||
| stepId?: string; | ||
| title?: string; | ||
| status?: RawStatus; | ||
| durationMs?: number; | ||
| errorMessage?: string; | ||
| } | ||
| /** Raw test case - best-effort data gathering */ | ||
| interface RawTestCase { | ||
| /** Framework's test ID */ | ||
| externalId?: string; | ||
| /** Test title/name */ | ||
| title?: string; | ||
| /** Full title path (describe blocks + test name) */ | ||
| titlePath?: string[]; | ||
| /** Story metadata from test */ | ||
| story?: StoryMeta; | ||
| /** Source file path */ | ||
| sourceFile?: string; | ||
| /** Source line number (1-based) */ | ||
| sourceLine?: number; | ||
| /** Test status */ | ||
| status: RawStatus; | ||
| /** Duration in milliseconds */ | ||
| durationMs?: number; | ||
| /** Error information */ | ||
| error?: { | ||
| message?: string; | ||
| stack?: string; | ||
| }; | ||
| /** Step-level info if framework provides it */ | ||
| stepEvents?: RawStepEvent[]; | ||
| /** Attachments (screenshots, logs, etc.) */ | ||
| attachments?: RawAttachment[]; | ||
| /** Framework-specific metadata (kept for debugging) */ | ||
| meta?: Record<string, unknown>; | ||
| /** | ||
| * Evidence ingested from external tools (mutation/coverage/failing-first). | ||
| * Not produced by framework adapters — injected at ingestion time and passed | ||
| * through to the canonical {@link TestCaseResult.evidence}. | ||
| */ | ||
| evidence?: TestCaseEvidence; | ||
| /** Retry attempt number (0-based) */ | ||
| retry?: number; | ||
| /** Total retry count configured */ | ||
| retries?: number; | ||
| /** Playwright project name */ | ||
| projectName?: string; | ||
| } | ||
| /** CI environment info */ | ||
| interface RawCIInfo { | ||
| name: string; | ||
| /** Typed provider key (stable identifier) */ | ||
| provider?: CIProvider; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| /** Git branch name */ | ||
| branch?: string; | ||
| /** Git commit SHA */ | ||
| commitSha?: string; | ||
| /** Pull/merge request number */ | ||
| prNumber?: string; | ||
| } | ||
| /** Raw run - all framework data gathered */ | ||
| interface RawRun { | ||
| /** All test cases from the run */ | ||
| testCases: RawTestCase[]; | ||
| /** Run start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| /** Run finish time (epoch ms) */ | ||
| finishedAtMs?: number; | ||
| /** Project root directory */ | ||
| projectRoot: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git commit SHA */ | ||
| gitSha?: string; | ||
| /** CI environment info */ | ||
| ci?: RawCIInfo; | ||
| } | ||
| /** Canonical test status (Cucumber-compatible) */ | ||
| type TestStatus = "passed" | "failed" | "skipped" | "pending"; | ||
| /** Step result with status and timing */ | ||
| interface StepResult { | ||
| /** Step index (0-based) */ | ||
| index: number; | ||
| /** Stable step ID when available */ | ||
| stepId?: string; | ||
| /** Step status */ | ||
| status: TestStatus; | ||
| /** Duration in milliseconds (default 0) */ | ||
| durationMs: number; | ||
| /** Error message if step failed */ | ||
| errorMessage?: string; | ||
| } | ||
| /** Resolved attachment (always has body) */ | ||
| interface Attachment { | ||
| /** Attachment name */ | ||
| name: string; | ||
| /** MIME type */ | ||
| mediaType: string; | ||
| /** Content (base64-encoded or URL) */ | ||
| body: string; | ||
| /** Content encoding */ | ||
| contentEncoding: "BASE64" | "IDENTITY"; | ||
| } | ||
| /** Single test attempt for retry tracking */ | ||
| interface TestCaseAttempt { | ||
| /** Attempt number (0-based) */ | ||
| attempt: number; | ||
| /** Status of this attempt */ | ||
| status: TestStatus; | ||
| /** Duration of this attempt in milliseconds */ | ||
| durationMs: number; | ||
| /** Error message if this attempt failed */ | ||
| errorMessage?: string; | ||
| /** Error stack trace if this attempt failed */ | ||
| errorStack?: string; | ||
| } | ||
| /** Canonical test case result */ | ||
| interface TestCaseResult { | ||
| /** Unique deterministic ID */ | ||
| id: string; | ||
| /** Story metadata (required) */ | ||
| story: StoryMeta; | ||
| /** Source file path (required) */ | ||
| sourceFile: string; | ||
| /** Source line number (required, default 1) */ | ||
| sourceLine: number; | ||
| /** Test status (required) */ | ||
| status: TestStatus; | ||
| /** Original adapter/framework status (preserved for diagnostics). */ | ||
| rawStatus?: RawStatus; | ||
| /** Duration in milliseconds (required, default 0) */ | ||
| durationMs: number; | ||
| /** Error message if failed */ | ||
| errorMessage?: string; | ||
| /** Error stack trace if failed */ | ||
| errorStack?: string; | ||
| /** Attachments (required, empty array if none) */ | ||
| attachments: Attachment[]; | ||
| /** Step results (required, always populated via fallback rules) */ | ||
| stepResults: StepResult[]; | ||
| /** Full title path from suite/describe blocks (required, empty array if none) */ | ||
| titlePath: string[]; | ||
| /** Playwright project name (optional) */ | ||
| projectName?: string; | ||
| /** Retry attempt number (required, default 0) */ | ||
| retry: number; | ||
| /** Total retries configured (required, default 0) */ | ||
| retries: number; | ||
| /** Normalized tags from story (required, empty array if none) */ | ||
| tags: string[]; | ||
| /** All retry attempts (optional, includes details per attempt) */ | ||
| attempts?: TestCaseAttempt[]; | ||
| /** | ||
| * Ingested evidence (mutation/coverage/failing-first) used by the review | ||
| * formatter to grade proof strength. Populated at the ACL/ingestion layer, | ||
| * never by adapters. Optional and additive. | ||
| */ | ||
| evidence?: TestCaseEvidence; | ||
| } | ||
| /** | ||
| * Evidence ingested from external tools to harden the "the test passes" claim. | ||
| * | ||
| * Populated at the ACL/ingestion layer from the host project's own tooling | ||
| * (Stryker/PITest mutation runs, coverage reports, base-ref re-verification). | ||
| * The packages never RUN these tools — same ingestion shape as {@link StoryMeta.otelSpans}. | ||
| * Consumed by the review formatter to grade how credible a claim's proof is. | ||
| */ | ||
| interface TestCaseEvidence { | ||
| /** Mutation score (0-100) attributed to this test/file, from Stryker/PITest/etc. */ | ||
| mutationScorePct?: number; | ||
| /** Mutants killed by this test's covered code (when the tool reports it). */ | ||
| mutantsKilled?: number; | ||
| /** Total mutants in this test's covered code (when the tool reports it). */ | ||
| mutantsTotal?: number; | ||
| /** | ||
| * True when the test was verified red on the base ref and green on head | ||
| * (the failing-first regression lock for bugfixes). | ||
| */ | ||
| failingFirstVerified?: boolean; | ||
| /** Coverage of the changed lines this test exercises (0-100), when computable. */ | ||
| changedLineCoveragePct?: number; | ||
| } | ||
| /** CI environment info */ | ||
| interface CIInfo { | ||
| name: string; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| branch?: string; | ||
| commitSha?: string; | ||
| prNumber?: string; | ||
| } | ||
| /** Coverage summary for the test run */ | ||
| interface CoverageSummary { | ||
| /** Line coverage percentage (0-100) */ | ||
| linesPct?: number; | ||
| /** Branch coverage percentage (0-100) */ | ||
| branchesPct?: number; | ||
| /** Function coverage percentage (0-100) */ | ||
| functionsPct?: number; | ||
| /** Statement coverage percentage (0-100) */ | ||
| statementsPct?: number; | ||
| } | ||
| /** Canonical test run result */ | ||
| interface TestRunResult { | ||
| /** All test case results */ | ||
| testCases: TestCaseResult[]; | ||
| /** Run start time (epoch ms, required) */ | ||
| startedAtMs: number; | ||
| /** Run finish time (epoch ms, required) */ | ||
| finishedAtMs: number; | ||
| /** Total duration in milliseconds (required) */ | ||
| durationMs: number; | ||
| /** Project root directory (required) */ | ||
| projectRoot: string; | ||
| /** Unique run ID (required, generated) */ | ||
| runId: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git commit SHA */ | ||
| gitSha?: string; | ||
| /** CI environment info */ | ||
| ci?: CIInfo; | ||
| /** Coverage summary for the run */ | ||
| coverage?: CoverageSummary; | ||
| } | ||
| /** | ||
| * Jest Adapter - Layer 1. | ||
| * | ||
| * Transforms Jest test results and story reports into RawRun. | ||
| */ | ||
| /** Jest test result shape (subset of what Jest provides) */ | ||
| interface JestTestResult { | ||
| fullName: string; | ||
| status: "passed" | "failed" | "pending" | "todo"; | ||
| duration?: number; | ||
| failureMessages?: string[]; | ||
| } | ||
| /** Jest file result shape */ | ||
| interface JestFileResult { | ||
| testFilePath: string; | ||
| testResults: JestTestResult[]; | ||
| } | ||
| /** Jest aggregated result shape */ | ||
| interface JestAggregatedResult { | ||
| testResults: JestFileResult[]; | ||
| startTime?: number; | ||
| } | ||
| /** Story file report written by story.init() */ | ||
| interface StoryFileReport { | ||
| testFilePath: string; | ||
| scenarios: StoryMeta[]; | ||
| } | ||
| /** Options for Jest adapter */ | ||
| interface JestAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| } | ||
| /** | ||
| * Adapt Jest results and story reports to RawRun. | ||
| * | ||
| * @param jestResults - Jest aggregated results | ||
| * @param storyReports - Story reports from story.init() | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptJestRun(jestResults: JestAggregatedResult, storyReports: StoryFileReport[], options?: JestAdapterOptions): RawRun; | ||
| /** | ||
| * Vitest Adapter - Layer 1. | ||
| * | ||
| * Transforms Vitest test results into RawRun. | ||
| */ | ||
| /** Vitest test state */ | ||
| type VitestState = "passed" | "failed" | "skipped" | "pending"; | ||
| /** Vitest serialized error */ | ||
| interface VitestSerializedError { | ||
| message?: string; | ||
| stack?: string; | ||
| diff?: string; | ||
| } | ||
| /** Vitest test result shape */ | ||
| interface VitestTestResult { | ||
| state?: VitestState; | ||
| duration?: number; | ||
| errors?: VitestSerializedError[]; | ||
| } | ||
| /** Vitest test case shape (minimal) */ | ||
| interface VitestTestCase { | ||
| name: string; | ||
| meta: () => Record<string, unknown>; | ||
| result: () => VitestTestResult | undefined; | ||
| } | ||
| /** Vitest test module shape (minimal) */ | ||
| interface VitestTestModule { | ||
| moduleId?: string; | ||
| relativeModuleId?: string; | ||
| children?: { | ||
| allTests: () => Iterable<VitestTestCase>; | ||
| }; | ||
| } | ||
| /** Options for Vitest adapter */ | ||
| interface VitestAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| /** Start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| } | ||
| /** | ||
| * Adapt Vitest test modules to RawRun. | ||
| * | ||
| * @param testModules - Vitest test modules | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptVitestRun(testModules: ReadonlyArray<VitestTestModule>, options?: VitestAdapterOptions): RawRun; | ||
| /** | ||
| * Playwright Adapter - Layer 1. | ||
| * | ||
| * Transforms Playwright test results into RawRun. | ||
| */ | ||
| /** Playwright test status */ | ||
| type PlaywrightStatus = "passed" | "failed" | "skipped" | "timedOut" | "interrupted"; | ||
| /** Playwright test error */ | ||
| interface PlaywrightError { | ||
| message?: string; | ||
| stack?: string; | ||
| } | ||
| /** Playwright attachment */ | ||
| interface PlaywrightAttachment { | ||
| name: string; | ||
| contentType: string; | ||
| path?: string; | ||
| body?: Buffer; | ||
| } | ||
| /** Playwright test result */ | ||
| interface PlaywrightTestResult { | ||
| status: PlaywrightStatus; | ||
| duration: number; | ||
| errors: PlaywrightError[]; | ||
| attachments: PlaywrightAttachment[]; | ||
| retry: number; | ||
| /** Optional step events if caller captures Playwright step timing. */ | ||
| stepEvents?: Array<{ | ||
| index?: number; | ||
| stepId?: string; | ||
| title?: string; | ||
| status?: RawStatus; | ||
| durationMs?: number; | ||
| errorMessage?: string; | ||
| }>; | ||
| } | ||
| /** Playwright test case annotation */ | ||
| interface PlaywrightAnnotation { | ||
| type: string; | ||
| description?: string; | ||
| } | ||
| /** Playwright test location */ | ||
| interface PlaywrightLocation { | ||
| file: string; | ||
| line: number; | ||
| column: number; | ||
| } | ||
| /** Playwright test case shape (minimal) */ | ||
| interface PlaywrightTestCase { | ||
| title: string; | ||
| titlePath: () => string[]; | ||
| annotations: PlaywrightAnnotation[]; | ||
| location: PlaywrightLocation; | ||
| retries: number; | ||
| } | ||
| /** Options for Playwright adapter */ | ||
| interface PlaywrightAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| /** Start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| /** Playwright project name */ | ||
| projectName?: string; | ||
| } | ||
| /** | ||
| * Adapt Playwright test results to RawRun. | ||
| * | ||
| * @param testResults - Array of [testCase, result] tuples | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun; | ||
| export { type Attachment as A, STORY_META_KEY as B, type CIInfo$1 as C, type DocEntry as D, type StepKeyword as E, type StepMode as F, type StoryFileReport as G, type StoryMeta as H, type TestCaseAttempt as I, type JestAdapterOptions as J, type TestCaseEvidence as K, type VitestSerializedError as L, type VitestState as M, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type VitestTestCase as Q, type RawStatus as R, type StoryStep as S, type TestRunResult as T, type VitestTestModule as U, type VitestAdapterOptions as V, type VitestTestResult as W, toCIInfo as X, toRawCIInfo as Y, type TestCaseResult as a, type TestStatus as b, type DocPhase as c, type StepResult as d, type CIProvider as e, type RawAttachment as f, type RawRun as g, type RawCIInfo as h, adaptJestRun as i, adaptPlaywrightRun as j, adaptVitestRun as k, type CIInfo as l, type CoverageSummary as m, type JestAggregatedResult as n, type JestFileResult as o, type JestTestResult as p, type OtelAttributeValue as q, type PlaywrightAnnotation as r, type PlaywrightAttachment as s, type PlaywrightError as t, type PlaywrightLocation as u, type PlaywrightStatus as v, type PlaywrightTestCase as w, type PlaywrightTestResult as x, type RawStepEvent as y, type RawTestCase as z }; |
| /** | ||
| * Typed CI provider and canonical CI info. | ||
| * | ||
| * RawCIInfo.name = legacy transport string (kept for backward compat + schema). | ||
| * CIInfo.displayName = canonical display name for downstream consumers. | ||
| * | ||
| * All downstream code (HTML meta, notifications, history) uses CIInfo via mappers. | ||
| */ | ||
| type CIProvider = "github" | "gitlab" | "circleci" | "jenkins" | "azure" | "buildkite" | "travis" | "unknown"; | ||
| interface CIInfo$1 { | ||
| provider: CIProvider; | ||
| displayName: string; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| branch?: string; | ||
| commitSha?: string; | ||
| prNumber?: string; | ||
| } | ||
| /** Convert RawCIInfo (legacy transport) to canonical CIInfo. */ | ||
| declare function toCIInfo(raw?: RawCIInfo): CIInfo$1 | undefined; | ||
| /** Convert canonical CIInfo back to RawCIInfo (for serialization). */ | ||
| declare function toRawCIInfo(ci?: CIInfo$1): RawCIInfo | undefined; | ||
| /** | ||
| * OTel span types for trace waterfall rendering. | ||
| * | ||
| * Structurally compatible with autotel's SerializedSpan | ||
| * and raw OTel nanosecond formats. No import dependency on autotel. | ||
| */ | ||
| type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[]; | ||
| interface OtelSpan { | ||
| spanId: string; | ||
| parentSpanId?: string; | ||
| name: string; | ||
| /** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */ | ||
| startTimeMs?: number; | ||
| durationMs?: number; | ||
| /** Compatibility: raw OTel nanosecond timestamps */ | ||
| startTimeUnixNano?: number; | ||
| endTimeUnixNano?: number; | ||
| status: "ok" | "error" | "unset"; | ||
| statusMessage?: string; | ||
| attributes?: Record<string, OtelAttributeValue>; | ||
| } | ||
| /** | ||
| * Story types — the shared vocabulary for all framework adapters. | ||
| * | ||
| * These types were previously in executable-stories-core. | ||
| * They now live in formatters so every adapter can import them | ||
| * from the same place that defines RawRun (the output contract). | ||
| */ | ||
| /** BDD step keywords for scenario documentation */ | ||
| type StepKeyword = "Given" | "When" | "Then" | "And" | "But"; | ||
| /** Step execution mode for docs rendering */ | ||
| type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent"; | ||
| /** Phase tracks when the doc entry was added */ | ||
| type DocPhase = "static" | "runtime"; | ||
| /** Union type for all documentation entry kinds */ | ||
| type DocEntry = { | ||
| kind: "note"; | ||
| text: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "tag"; | ||
| names: string[]; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "kv"; | ||
| label: string; | ||
| value: unknown; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "code"; | ||
| label: string; | ||
| content: string; | ||
| lang?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "table"; | ||
| label: string; | ||
| columns: string[]; | ||
| rows: string[][]; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "link"; | ||
| label: string; | ||
| url: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "section"; | ||
| title: string; | ||
| markdown: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "mermaid"; | ||
| code: string; | ||
| title?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "screenshot"; | ||
| path: string; | ||
| alt?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "video"; | ||
| path: string; | ||
| caption?: string; | ||
| poster?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "custom"; | ||
| type: string; | ||
| data: unknown; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| }; | ||
| /** | ||
| * A single step in a scenario with its documentation entries. | ||
| */ | ||
| interface StoryStep { | ||
| /** Stable internal ID (auto-generated at creation, e.g., "step-0") */ | ||
| id?: string; | ||
| /** The BDD keyword (Given, When, Then, And, But) */ | ||
| keyword: StepKeyword; | ||
| /** The step description text */ | ||
| text: string; | ||
| /** Step execution mode for docs rendering */ | ||
| mode?: StepMode; | ||
| /** Rich documentation entries attached to this step */ | ||
| docs?: DocEntry[]; | ||
| /** Opt-in step duration in milliseconds */ | ||
| durationMs?: number; | ||
| /** Whether this step wrapped a function body (step.fn / step.step) vs a text marker */ | ||
| wrapped?: boolean; | ||
| } | ||
| /** A ticket reference with an optional direct URL */ | ||
| interface NormalizedTicket { | ||
| /** Ticket identifier (e.g., "JIRA-123", "PAY-1042") */ | ||
| id: string; | ||
| /** Direct URL to the ticket (overrides ticketUrlTemplate) */ | ||
| url?: string; | ||
| } | ||
| /** | ||
| * Metadata for a complete scenario, attached to test metadata. | ||
| * Used by reporters to generate documentation. | ||
| */ | ||
| interface StoryMeta { | ||
| /** The scenario title (from test name) */ | ||
| scenario: string; | ||
| /** All steps in this scenario */ | ||
| steps: StoryStep[]; | ||
| /** Tags for filtering and categorization */ | ||
| tags?: string[]; | ||
| /** Ticket/issue references (normalized to array) */ | ||
| tickets?: NormalizedTicket[]; | ||
| /** Product-code paths/globs this scenario exercises (project-root-relative). */ | ||
| covers?: string[]; | ||
| /** User-defined metadata */ | ||
| meta?: Record<string, unknown>; | ||
| /** Parent describe/suite names for hierarchical grouping */ | ||
| suitePath?: string[]; | ||
| /** Story-level docs (before any steps) */ | ||
| docs?: DocEntry[]; | ||
| /** Order in which story.init() was called (for source ordering) */ | ||
| sourceOrder?: number; | ||
| /** OTel spans from autotel for trace waterfall rendering */ | ||
| otelSpans?: OtelSpan[]; | ||
| } | ||
| /** Key used to store StoryMeta in test metadata */ | ||
| declare const STORY_META_KEY = "story"; | ||
| /** Permissive status from any framework */ | ||
| type RawStatus = "pass" | "fail" | "skip" | "todo" | "pending" | "timeout" | "interrupted" | "unknown"; | ||
| /** Raw attachment - don't decide inline vs link yet */ | ||
| interface RawAttachment { | ||
| name: string; | ||
| mediaType: string; | ||
| /** File reference (path on disk) */ | ||
| path?: string; | ||
| /** Inline content */ | ||
| body?: string; | ||
| /** Content encoding */ | ||
| encoding?: "BASE64" | "IDENTITY"; | ||
| /** Character set (default: "utf-8" when IDENTITY + text) */ | ||
| charset?: string; | ||
| /** Actual artifact name (distinct from logical label) */ | ||
| fileName?: string; | ||
| /** Size in bytes (for embed vs link decision) */ | ||
| byteLength?: number; | ||
| /** Step index (undefined = test-case level) */ | ||
| stepIndex?: number; | ||
| /** Stable step ID, preferred over stepIndex by converter */ | ||
| stepId?: string; | ||
| } | ||
| /** Raw step event from framework (if available) */ | ||
| interface RawStepEvent { | ||
| index?: number; | ||
| stepId?: string; | ||
| title?: string; | ||
| status?: RawStatus; | ||
| durationMs?: number; | ||
| errorMessage?: string; | ||
| } | ||
| /** Raw test case - best-effort data gathering */ | ||
| interface RawTestCase { | ||
| /** Framework's test ID */ | ||
| externalId?: string; | ||
| /** Test title/name */ | ||
| title?: string; | ||
| /** Full title path (describe blocks + test name) */ | ||
| titlePath?: string[]; | ||
| /** Story metadata from test */ | ||
| story?: StoryMeta; | ||
| /** Source file path */ | ||
| sourceFile?: string; | ||
| /** Source line number (1-based) */ | ||
| sourceLine?: number; | ||
| /** Test status */ | ||
| status: RawStatus; | ||
| /** Duration in milliseconds */ | ||
| durationMs?: number; | ||
| /** Error information */ | ||
| error?: { | ||
| message?: string; | ||
| stack?: string; | ||
| }; | ||
| /** Step-level info if framework provides it */ | ||
| stepEvents?: RawStepEvent[]; | ||
| /** Attachments (screenshots, logs, etc.) */ | ||
| attachments?: RawAttachment[]; | ||
| /** Framework-specific metadata (kept for debugging) */ | ||
| meta?: Record<string, unknown>; | ||
| /** | ||
| * Evidence ingested from external tools (mutation/coverage/failing-first). | ||
| * Not produced by framework adapters — injected at ingestion time and passed | ||
| * through to the canonical {@link TestCaseResult.evidence}. | ||
| */ | ||
| evidence?: TestCaseEvidence; | ||
| /** Retry attempt number (0-based) */ | ||
| retry?: number; | ||
| /** Total retry count configured */ | ||
| retries?: number; | ||
| /** Playwright project name */ | ||
| projectName?: string; | ||
| } | ||
| /** CI environment info */ | ||
| interface RawCIInfo { | ||
| name: string; | ||
| /** Typed provider key (stable identifier) */ | ||
| provider?: CIProvider; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| /** Git branch name */ | ||
| branch?: string; | ||
| /** Git commit SHA */ | ||
| commitSha?: string; | ||
| /** Pull/merge request number */ | ||
| prNumber?: string; | ||
| } | ||
| /** Raw run - all framework data gathered */ | ||
| interface RawRun { | ||
| /** All test cases from the run */ | ||
| testCases: RawTestCase[]; | ||
| /** Run start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| /** Run finish time (epoch ms) */ | ||
| finishedAtMs?: number; | ||
| /** Project root directory */ | ||
| projectRoot: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git commit SHA */ | ||
| gitSha?: string; | ||
| /** CI environment info */ | ||
| ci?: RawCIInfo; | ||
| } | ||
| /** Canonical test status (Cucumber-compatible) */ | ||
| type TestStatus = "passed" | "failed" | "skipped" | "pending"; | ||
| /** Step result with status and timing */ | ||
| interface StepResult { | ||
| /** Step index (0-based) */ | ||
| index: number; | ||
| /** Stable step ID when available */ | ||
| stepId?: string; | ||
| /** Step status */ | ||
| status: TestStatus; | ||
| /** Duration in milliseconds (default 0) */ | ||
| durationMs: number; | ||
| /** Error message if step failed */ | ||
| errorMessage?: string; | ||
| } | ||
| /** Resolved attachment (always has body) */ | ||
| interface Attachment { | ||
| /** Attachment name */ | ||
| name: string; | ||
| /** MIME type */ | ||
| mediaType: string; | ||
| /** Content (base64-encoded or URL) */ | ||
| body: string; | ||
| /** Content encoding */ | ||
| contentEncoding: "BASE64" | "IDENTITY"; | ||
| } | ||
| /** Single test attempt for retry tracking */ | ||
| interface TestCaseAttempt { | ||
| /** Attempt number (0-based) */ | ||
| attempt: number; | ||
| /** Status of this attempt */ | ||
| status: TestStatus; | ||
| /** Duration of this attempt in milliseconds */ | ||
| durationMs: number; | ||
| /** Error message if this attempt failed */ | ||
| errorMessage?: string; | ||
| /** Error stack trace if this attempt failed */ | ||
| errorStack?: string; | ||
| } | ||
| /** Canonical test case result */ | ||
| interface TestCaseResult { | ||
| /** Unique deterministic ID */ | ||
| id: string; | ||
| /** Story metadata (required) */ | ||
| story: StoryMeta; | ||
| /** Source file path (required) */ | ||
| sourceFile: string; | ||
| /** Source line number (required, default 1) */ | ||
| sourceLine: number; | ||
| /** Test status (required) */ | ||
| status: TestStatus; | ||
| /** Original adapter/framework status (preserved for diagnostics). */ | ||
| rawStatus?: RawStatus; | ||
| /** Duration in milliseconds (required, default 0) */ | ||
| durationMs: number; | ||
| /** Error message if failed */ | ||
| errorMessage?: string; | ||
| /** Error stack trace if failed */ | ||
| errorStack?: string; | ||
| /** Attachments (required, empty array if none) */ | ||
| attachments: Attachment[]; | ||
| /** Step results (required, always populated via fallback rules) */ | ||
| stepResults: StepResult[]; | ||
| /** Full title path from suite/describe blocks (required, empty array if none) */ | ||
| titlePath: string[]; | ||
| /** Playwright project name (optional) */ | ||
| projectName?: string; | ||
| /** Retry attempt number (required, default 0) */ | ||
| retry: number; | ||
| /** Total retries configured (required, default 0) */ | ||
| retries: number; | ||
| /** Normalized tags from story (required, empty array if none) */ | ||
| tags: string[]; | ||
| /** All retry attempts (optional, includes details per attempt) */ | ||
| attempts?: TestCaseAttempt[]; | ||
| /** | ||
| * Ingested evidence (mutation/coverage/failing-first) used by the review | ||
| * formatter to grade proof strength. Populated at the ACL/ingestion layer, | ||
| * never by adapters. Optional and additive. | ||
| */ | ||
| evidence?: TestCaseEvidence; | ||
| } | ||
| /** | ||
| * Evidence ingested from external tools to harden the "the test passes" claim. | ||
| * | ||
| * Populated at the ACL/ingestion layer from the host project's own tooling | ||
| * (Stryker/PITest mutation runs, coverage reports, base-ref re-verification). | ||
| * The packages never RUN these tools — same ingestion shape as {@link StoryMeta.otelSpans}. | ||
| * Consumed by the review formatter to grade how credible a claim's proof is. | ||
| */ | ||
| interface TestCaseEvidence { | ||
| /** Mutation score (0-100) attributed to this test/file, from Stryker/PITest/etc. */ | ||
| mutationScorePct?: number; | ||
| /** Mutants killed by this test's covered code (when the tool reports it). */ | ||
| mutantsKilled?: number; | ||
| /** Total mutants in this test's covered code (when the tool reports it). */ | ||
| mutantsTotal?: number; | ||
| /** | ||
| * True when the test was verified red on the base ref and green on head | ||
| * (the failing-first regression lock for bugfixes). | ||
| */ | ||
| failingFirstVerified?: boolean; | ||
| /** Coverage of the changed lines this test exercises (0-100), when computable. */ | ||
| changedLineCoveragePct?: number; | ||
| } | ||
| /** CI environment info */ | ||
| interface CIInfo { | ||
| name: string; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| branch?: string; | ||
| commitSha?: string; | ||
| prNumber?: string; | ||
| } | ||
| /** Coverage summary for the test run */ | ||
| interface CoverageSummary { | ||
| /** Line coverage percentage (0-100) */ | ||
| linesPct?: number; | ||
| /** Branch coverage percentage (0-100) */ | ||
| branchesPct?: number; | ||
| /** Function coverage percentage (0-100) */ | ||
| functionsPct?: number; | ||
| /** Statement coverage percentage (0-100) */ | ||
| statementsPct?: number; | ||
| } | ||
| /** Canonical test run result */ | ||
| interface TestRunResult { | ||
| /** All test case results */ | ||
| testCases: TestCaseResult[]; | ||
| /** Run start time (epoch ms, required) */ | ||
| startedAtMs: number; | ||
| /** Run finish time (epoch ms, required) */ | ||
| finishedAtMs: number; | ||
| /** Total duration in milliseconds (required) */ | ||
| durationMs: number; | ||
| /** Project root directory (required) */ | ||
| projectRoot: string; | ||
| /** Unique run ID (required, generated) */ | ||
| runId: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git commit SHA */ | ||
| gitSha?: string; | ||
| /** CI environment info */ | ||
| ci?: CIInfo; | ||
| /** Coverage summary for the run */ | ||
| coverage?: CoverageSummary; | ||
| } | ||
| /** | ||
| * Jest Adapter - Layer 1. | ||
| * | ||
| * Transforms Jest test results and story reports into RawRun. | ||
| */ | ||
| /** Jest test result shape (subset of what Jest provides) */ | ||
| interface JestTestResult { | ||
| fullName: string; | ||
| status: "passed" | "failed" | "pending" | "todo"; | ||
| duration?: number; | ||
| failureMessages?: string[]; | ||
| } | ||
| /** Jest file result shape */ | ||
| interface JestFileResult { | ||
| testFilePath: string; | ||
| testResults: JestTestResult[]; | ||
| } | ||
| /** Jest aggregated result shape */ | ||
| interface JestAggregatedResult { | ||
| testResults: JestFileResult[]; | ||
| startTime?: number; | ||
| } | ||
| /** Story file report written by story.init() */ | ||
| interface StoryFileReport { | ||
| testFilePath: string; | ||
| scenarios: StoryMeta[]; | ||
| } | ||
| /** Options for Jest adapter */ | ||
| interface JestAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| } | ||
| /** | ||
| * Adapt Jest results and story reports to RawRun. | ||
| * | ||
| * @param jestResults - Jest aggregated results | ||
| * @param storyReports - Story reports from story.init() | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptJestRun(jestResults: JestAggregatedResult, storyReports: StoryFileReport[], options?: JestAdapterOptions): RawRun; | ||
| /** | ||
| * Vitest Adapter - Layer 1. | ||
| * | ||
| * Transforms Vitest test results into RawRun. | ||
| */ | ||
| /** Vitest test state */ | ||
| type VitestState = "passed" | "failed" | "skipped" | "pending"; | ||
| /** Vitest serialized error */ | ||
| interface VitestSerializedError { | ||
| message?: string; | ||
| stack?: string; | ||
| diff?: string; | ||
| } | ||
| /** Vitest test result shape */ | ||
| interface VitestTestResult { | ||
| state?: VitestState; | ||
| duration?: number; | ||
| errors?: VitestSerializedError[]; | ||
| } | ||
| /** Vitest test case shape (minimal) */ | ||
| interface VitestTestCase { | ||
| name: string; | ||
| meta: () => Record<string, unknown>; | ||
| result: () => VitestTestResult | undefined; | ||
| } | ||
| /** Vitest test module shape (minimal) */ | ||
| interface VitestTestModule { | ||
| moduleId?: string; | ||
| relativeModuleId?: string; | ||
| children?: { | ||
| allTests: () => Iterable<VitestTestCase>; | ||
| }; | ||
| } | ||
| /** Options for Vitest adapter */ | ||
| interface VitestAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| /** Start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| } | ||
| /** | ||
| * Adapt Vitest test modules to RawRun. | ||
| * | ||
| * @param testModules - Vitest test modules | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptVitestRun(testModules: ReadonlyArray<VitestTestModule>, options?: VitestAdapterOptions): RawRun; | ||
| /** | ||
| * Playwright Adapter - Layer 1. | ||
| * | ||
| * Transforms Playwright test results into RawRun. | ||
| */ | ||
| /** Playwright test status */ | ||
| type PlaywrightStatus = "passed" | "failed" | "skipped" | "timedOut" | "interrupted"; | ||
| /** Playwright test error */ | ||
| interface PlaywrightError { | ||
| message?: string; | ||
| stack?: string; | ||
| } | ||
| /** Playwright attachment */ | ||
| interface PlaywrightAttachment { | ||
| name: string; | ||
| contentType: string; | ||
| path?: string; | ||
| body?: Buffer; | ||
| } | ||
| /** Playwright test result */ | ||
| interface PlaywrightTestResult { | ||
| status: PlaywrightStatus; | ||
| duration: number; | ||
| errors: PlaywrightError[]; | ||
| attachments: PlaywrightAttachment[]; | ||
| retry: number; | ||
| /** Optional step events if caller captures Playwright step timing. */ | ||
| stepEvents?: Array<{ | ||
| index?: number; | ||
| stepId?: string; | ||
| title?: string; | ||
| status?: RawStatus; | ||
| durationMs?: number; | ||
| errorMessage?: string; | ||
| }>; | ||
| } | ||
| /** Playwright test case annotation */ | ||
| interface PlaywrightAnnotation { | ||
| type: string; | ||
| description?: string; | ||
| } | ||
| /** Playwright test location */ | ||
| interface PlaywrightLocation { | ||
| file: string; | ||
| line: number; | ||
| column: number; | ||
| } | ||
| /** Playwright test case shape (minimal) */ | ||
| interface PlaywrightTestCase { | ||
| title: string; | ||
| titlePath: () => string[]; | ||
| annotations: PlaywrightAnnotation[]; | ||
| location: PlaywrightLocation; | ||
| retries: number; | ||
| } | ||
| /** Options for Playwright adapter */ | ||
| interface PlaywrightAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| /** Start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| /** Playwright project name */ | ||
| projectName?: string; | ||
| } | ||
| /** | ||
| * Adapt Playwright test results to RawRun. | ||
| * | ||
| * @param testResults - Array of [testCase, result] tuples | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun; | ||
| export { type Attachment as A, STORY_META_KEY as B, type CIInfo$1 as C, type DocEntry as D, type StepKeyword as E, type StepMode as F, type StoryFileReport as G, type StoryMeta as H, type TestCaseAttempt as I, type JestAdapterOptions as J, type TestCaseEvidence as K, type VitestSerializedError as L, type VitestState as M, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type VitestTestCase as Q, type RawStatus as R, type StoryStep as S, type TestRunResult as T, type VitestTestModule as U, type VitestAdapterOptions as V, type VitestTestResult as W, toCIInfo as X, toRawCIInfo as Y, type TestCaseResult as a, type TestStatus as b, type DocPhase as c, type StepResult as d, type CIProvider as e, type RawAttachment as f, type RawRun as g, type RawCIInfo as h, adaptJestRun as i, adaptPlaywrightRun as j, adaptVitestRun as k, type CIInfo as l, type CoverageSummary as m, type JestAggregatedResult as n, type JestFileResult as o, type JestTestResult as p, type OtelAttributeValue as q, type PlaywrightAnnotation as r, type PlaywrightAttachment as s, type PlaywrightError as t, type PlaywrightLocation as u, type PlaywrightStatus as v, type PlaywrightTestCase as w, type PlaywrightTestResult as x, type RawStepEvent as y, type RawTestCase as z }; |
@@ -1,1 +0,1 @@ | ||
| export { J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, G as StoryFileReport, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-CbWFyoTx.cjs'; | ||
| export { J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, G as StoryFileReport, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-DF16Xl5i.cjs'; |
@@ -1,1 +0,1 @@ | ||
| export { J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, G as StoryFileReport, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-CbWFyoTx.js'; | ||
| export { J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, G as StoryFileReport, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-DF16Xl5i.js'; |
+3
-2
| { | ||
| "name": "executable-stories-formatters", | ||
| "version": "0.10.0", | ||
| "version": "0.11.0", | ||
| "description": "Cucumber-compatible report formats (HTML, Markdown, JUnit XML, Cucumber JSON) for executable-stories test results.", | ||
@@ -59,3 +59,4 @@ "author": "Jag Reehal <jag@jagreehal.com>", | ||
| "@cucumber/messages": "^32.3.1", | ||
| "ajv": "^8.20.0" | ||
| "ajv": "^8.20.0", | ||
| "yaml": "^2.8.3" | ||
| }, | ||
@@ -62,0 +63,0 @@ "devDependencies": { |
+35
-0
@@ -138,2 +138,37 @@ # executable-stories-formatters | ||
| ## Living docs site (Confluence replacement) | ||
| Scaffold an Astro/Starlight site whose pages stay honest because the tests keep | ||
| them verified. These commands operate on the canonical story report, so they | ||
| work for stories written in **any language** (TypeScript, Python, Go, Ruby, | ||
| Java/Kotlin, Rust, C#). | ||
| ```bash | ||
| # 1. Scaffold the site (ships verified-by badges, a health dashboard, explorer) | ||
| executable-stories init-astro story-docs | ||
| # 2. Generate story pages + report data from any test run | ||
| executable-stories format run.json --format astro --output-dir story-docs/src/content/docs/stories --asset-mode copy | ||
| executable-stories format run.json --format story-report-json --output-dir story-docs/public/stories --output-name story-report | ||
| # 3. Start hand-written pages from a verified template | ||
| executable-stories new adr "Cap combined discount at 30%" # also: runbook, decision-log, incident | ||
| # 4. Generate API docs with per-endpoint test coverage | ||
| executable-stories import-openapi openapi.json --run run.json --output-dir story-docs/src/content/docs/api | ||
| # 5. Fail CI if docs links rot | ||
| executable-stories check-links story-docs/src/content/docs | ||
| ``` | ||
| Any page can declare the stories that prove it. The badge under the title turns | ||
| red the moment a linked story fails: | ||
| ```yaml | ||
| --- | ||
| title: ADR 0007 — Cap combined discount at 30% | ||
| verifiedBy: [pricing, checkout--caps-the-discount-at-30-percent] | ||
| --- | ||
| ``` | ||
| ## Architecture | ||
@@ -140,0 +175,0 @@ |
@@ -201,2 +201,7 @@ { | ||
| "description": "Order in which the story was defined in source (for stable sorting)." | ||
| }, | ||
| "otelSpans": { | ||
| "type": "array", | ||
| "items": { "type": "object" }, | ||
| "description": "OpenTelemetry spans captured for this scenario (from autotel), used to render a trace waterfall." | ||
| } | ||
@@ -392,2 +397,16 @@ }, | ||
| "type": "object", | ||
| "description": "Video reference with optional caption and poster image.", | ||
| "properties": { | ||
| "kind": { "const": "video" }, | ||
| "path": { "type": "string" }, | ||
| "caption": { "type": "string" }, | ||
| "poster": { "type": "string" }, | ||
| "phase": { "$ref": "#/$defs/DocPhase" }, | ||
| "children": { "type": "array", "items": { "$ref": "#/$defs/DocEntry" }, "description": "Nested child doc entries for grouping." } | ||
| }, | ||
| "required": ["kind", "path", "phase"], | ||
| "additionalProperties": false | ||
| }, | ||
| { | ||
| "type": "object", | ||
| "description": "Custom documentation entry with arbitrary data.", | ||
@@ -394,0 +413,0 @@ "properties": { |
@@ -255,2 +255,3 @@ { | ||
| { "$ref": "#/$defs/DocScreenshot" }, | ||
| { "$ref": "#/$defs/DocVideo" }, | ||
| { "$ref": "#/$defs/DocCustom" } | ||
@@ -400,2 +401,18 @@ ] | ||
| }, | ||
| "DocVideo": { | ||
| "type": "object", | ||
| "properties": { | ||
| "kind": { "const": "video" }, | ||
| "path": { "type": "string" }, | ||
| "caption": { "type": "string" }, | ||
| "poster": { "type": "string" }, | ||
| "phase": { "$ref": "#/$defs/DocPhase" }, | ||
| "children": { | ||
| "type": "array", | ||
| "items": { "$ref": "#/$defs/DocEntry" } | ||
| } | ||
| }, | ||
| "required": ["kind", "path", "phase"], | ||
| "additionalProperties": false | ||
| }, | ||
| "DocCustom": { | ||
@@ -402,0 +419,0 @@ "type": "object", |
| /** | ||
| * Typed CI provider and canonical CI info. | ||
| * | ||
| * RawCIInfo.name = legacy transport string (kept for backward compat + schema). | ||
| * CIInfo.displayName = canonical display name for downstream consumers. | ||
| * | ||
| * All downstream code (HTML meta, notifications, history) uses CIInfo via mappers. | ||
| */ | ||
| type CIProvider = "github" | "gitlab" | "circleci" | "jenkins" | "azure" | "buildkite" | "travis" | "unknown"; | ||
| interface CIInfo$1 { | ||
| provider: CIProvider; | ||
| displayName: string; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| branch?: string; | ||
| commitSha?: string; | ||
| prNumber?: string; | ||
| } | ||
| /** Convert RawCIInfo (legacy transport) to canonical CIInfo. */ | ||
| declare function toCIInfo(raw?: RawCIInfo): CIInfo$1 | undefined; | ||
| /** Convert canonical CIInfo back to RawCIInfo (for serialization). */ | ||
| declare function toRawCIInfo(ci?: CIInfo$1): RawCIInfo | undefined; | ||
| /** | ||
| * OTel span types for trace waterfall rendering. | ||
| * | ||
| * Structurally compatible with autotel's SerializedSpan | ||
| * and raw OTel nanosecond formats. No import dependency on autotel. | ||
| */ | ||
| type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[]; | ||
| interface OtelSpan { | ||
| spanId: string; | ||
| parentSpanId?: string; | ||
| name: string; | ||
| /** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */ | ||
| startTimeMs?: number; | ||
| durationMs?: number; | ||
| /** Compatibility: raw OTel nanosecond timestamps */ | ||
| startTimeUnixNano?: number; | ||
| endTimeUnixNano?: number; | ||
| status: "ok" | "error" | "unset"; | ||
| statusMessage?: string; | ||
| attributes?: Record<string, OtelAttributeValue>; | ||
| } | ||
| /** | ||
| * Story types — the shared vocabulary for all framework adapters. | ||
| * | ||
| * These types were previously in executable-stories-core. | ||
| * They now live in formatters so every adapter can import them | ||
| * from the same place that defines RawRun (the output contract). | ||
| */ | ||
| /** BDD step keywords for scenario documentation */ | ||
| type StepKeyword = "Given" | "When" | "Then" | "And" | "But"; | ||
| /** Step execution mode for docs rendering */ | ||
| type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent"; | ||
| /** Phase tracks when the doc entry was added */ | ||
| type DocPhase = "static" | "runtime"; | ||
| /** Union type for all documentation entry kinds */ | ||
| type DocEntry = { | ||
| kind: "note"; | ||
| text: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "tag"; | ||
| names: string[]; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "kv"; | ||
| label: string; | ||
| value: unknown; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "code"; | ||
| label: string; | ||
| content: string; | ||
| lang?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "table"; | ||
| label: string; | ||
| columns: string[]; | ||
| rows: string[][]; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "link"; | ||
| label: string; | ||
| url: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "section"; | ||
| title: string; | ||
| markdown: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "mermaid"; | ||
| code: string; | ||
| title?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "screenshot"; | ||
| path: string; | ||
| alt?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "custom"; | ||
| type: string; | ||
| data: unknown; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| }; | ||
| /** | ||
| * A single step in a scenario with its documentation entries. | ||
| */ | ||
| interface StoryStep { | ||
| /** Stable internal ID (auto-generated at creation, e.g., "step-0") */ | ||
| id?: string; | ||
| /** The BDD keyword (Given, When, Then, And, But) */ | ||
| keyword: StepKeyword; | ||
| /** The step description text */ | ||
| text: string; | ||
| /** Step execution mode for docs rendering */ | ||
| mode?: StepMode; | ||
| /** Rich documentation entries attached to this step */ | ||
| docs?: DocEntry[]; | ||
| /** Opt-in step duration in milliseconds */ | ||
| durationMs?: number; | ||
| /** Whether this step wrapped a function body (step.fn / step.step) vs a text marker */ | ||
| wrapped?: boolean; | ||
| } | ||
| /** A ticket reference with an optional direct URL */ | ||
| interface NormalizedTicket { | ||
| /** Ticket identifier (e.g., "JIRA-123", "PAY-1042") */ | ||
| id: string; | ||
| /** Direct URL to the ticket (overrides ticketUrlTemplate) */ | ||
| url?: string; | ||
| } | ||
| /** | ||
| * Metadata for a complete scenario, attached to test metadata. | ||
| * Used by reporters to generate documentation. | ||
| */ | ||
| interface StoryMeta { | ||
| /** The scenario title (from test name) */ | ||
| scenario: string; | ||
| /** All steps in this scenario */ | ||
| steps: StoryStep[]; | ||
| /** Tags for filtering and categorization */ | ||
| tags?: string[]; | ||
| /** Ticket/issue references (normalized to array) */ | ||
| tickets?: NormalizedTicket[]; | ||
| /** Product-code paths/globs this scenario exercises (project-root-relative). */ | ||
| covers?: string[]; | ||
| /** User-defined metadata */ | ||
| meta?: Record<string, unknown>; | ||
| /** Parent describe/suite names for hierarchical grouping */ | ||
| suitePath?: string[]; | ||
| /** Story-level docs (before any steps) */ | ||
| docs?: DocEntry[]; | ||
| /** Order in which story.init() was called (for source ordering) */ | ||
| sourceOrder?: number; | ||
| /** OTel spans from autotel for trace waterfall rendering */ | ||
| otelSpans?: OtelSpan[]; | ||
| } | ||
| /** Key used to store StoryMeta in test metadata */ | ||
| declare const STORY_META_KEY = "story"; | ||
| /** Permissive status from any framework */ | ||
| type RawStatus = "pass" | "fail" | "skip" | "todo" | "pending" | "timeout" | "interrupted" | "unknown"; | ||
| /** Raw attachment - don't decide inline vs link yet */ | ||
| interface RawAttachment { | ||
| name: string; | ||
| mediaType: string; | ||
| /** File reference (path on disk) */ | ||
| path?: string; | ||
| /** Inline content */ | ||
| body?: string; | ||
| /** Content encoding */ | ||
| encoding?: "BASE64" | "IDENTITY"; | ||
| /** Character set (default: "utf-8" when IDENTITY + text) */ | ||
| charset?: string; | ||
| /** Actual artifact name (distinct from logical label) */ | ||
| fileName?: string; | ||
| /** Size in bytes (for embed vs link decision) */ | ||
| byteLength?: number; | ||
| /** Step index (undefined = test-case level) */ | ||
| stepIndex?: number; | ||
| /** Stable step ID, preferred over stepIndex by converter */ | ||
| stepId?: string; | ||
| } | ||
| /** Raw step event from framework (if available) */ | ||
| interface RawStepEvent { | ||
| index?: number; | ||
| stepId?: string; | ||
| title?: string; | ||
| status?: RawStatus; | ||
| durationMs?: number; | ||
| errorMessage?: string; | ||
| } | ||
| /** Raw test case - best-effort data gathering */ | ||
| interface RawTestCase { | ||
| /** Framework's test ID */ | ||
| externalId?: string; | ||
| /** Test title/name */ | ||
| title?: string; | ||
| /** Full title path (describe blocks + test name) */ | ||
| titlePath?: string[]; | ||
| /** Story metadata from test */ | ||
| story?: StoryMeta; | ||
| /** Source file path */ | ||
| sourceFile?: string; | ||
| /** Source line number (1-based) */ | ||
| sourceLine?: number; | ||
| /** Test status */ | ||
| status: RawStatus; | ||
| /** Duration in milliseconds */ | ||
| durationMs?: number; | ||
| /** Error information */ | ||
| error?: { | ||
| message?: string; | ||
| stack?: string; | ||
| }; | ||
| /** Step-level info if framework provides it */ | ||
| stepEvents?: RawStepEvent[]; | ||
| /** Attachments (screenshots, logs, etc.) */ | ||
| attachments?: RawAttachment[]; | ||
| /** Framework-specific metadata (kept for debugging) */ | ||
| meta?: Record<string, unknown>; | ||
| /** | ||
| * Evidence ingested from external tools (mutation/coverage/failing-first). | ||
| * Not produced by framework adapters — injected at ingestion time and passed | ||
| * through to the canonical {@link TestCaseResult.evidence}. | ||
| */ | ||
| evidence?: TestCaseEvidence; | ||
| /** Retry attempt number (0-based) */ | ||
| retry?: number; | ||
| /** Total retry count configured */ | ||
| retries?: number; | ||
| /** Playwright project name */ | ||
| projectName?: string; | ||
| } | ||
| /** CI environment info */ | ||
| interface RawCIInfo { | ||
| name: string; | ||
| /** Typed provider key (stable identifier) */ | ||
| provider?: CIProvider; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| /** Git branch name */ | ||
| branch?: string; | ||
| /** Git commit SHA */ | ||
| commitSha?: string; | ||
| /** Pull/merge request number */ | ||
| prNumber?: string; | ||
| } | ||
| /** Raw run - all framework data gathered */ | ||
| interface RawRun { | ||
| /** All test cases from the run */ | ||
| testCases: RawTestCase[]; | ||
| /** Run start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| /** Run finish time (epoch ms) */ | ||
| finishedAtMs?: number; | ||
| /** Project root directory */ | ||
| projectRoot: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git commit SHA */ | ||
| gitSha?: string; | ||
| /** CI environment info */ | ||
| ci?: RawCIInfo; | ||
| } | ||
| /** Canonical test status (Cucumber-compatible) */ | ||
| type TestStatus = "passed" | "failed" | "skipped" | "pending"; | ||
| /** Step result with status and timing */ | ||
| interface StepResult { | ||
| /** Step index (0-based) */ | ||
| index: number; | ||
| /** Stable step ID when available */ | ||
| stepId?: string; | ||
| /** Step status */ | ||
| status: TestStatus; | ||
| /** Duration in milliseconds (default 0) */ | ||
| durationMs: number; | ||
| /** Error message if step failed */ | ||
| errorMessage?: string; | ||
| } | ||
| /** Resolved attachment (always has body) */ | ||
| interface Attachment { | ||
| /** Attachment name */ | ||
| name: string; | ||
| /** MIME type */ | ||
| mediaType: string; | ||
| /** Content (base64-encoded or URL) */ | ||
| body: string; | ||
| /** Content encoding */ | ||
| contentEncoding: "BASE64" | "IDENTITY"; | ||
| } | ||
| /** Single test attempt for retry tracking */ | ||
| interface TestCaseAttempt { | ||
| /** Attempt number (0-based) */ | ||
| attempt: number; | ||
| /** Status of this attempt */ | ||
| status: TestStatus; | ||
| /** Duration of this attempt in milliseconds */ | ||
| durationMs: number; | ||
| /** Error message if this attempt failed */ | ||
| errorMessage?: string; | ||
| /** Error stack trace if this attempt failed */ | ||
| errorStack?: string; | ||
| } | ||
| /** Canonical test case result */ | ||
| interface TestCaseResult { | ||
| /** Unique deterministic ID */ | ||
| id: string; | ||
| /** Story metadata (required) */ | ||
| story: StoryMeta; | ||
| /** Source file path (required) */ | ||
| sourceFile: string; | ||
| /** Source line number (required, default 1) */ | ||
| sourceLine: number; | ||
| /** Test status (required) */ | ||
| status: TestStatus; | ||
| /** Original adapter/framework status (preserved for diagnostics). */ | ||
| rawStatus?: RawStatus; | ||
| /** Duration in milliseconds (required, default 0) */ | ||
| durationMs: number; | ||
| /** Error message if failed */ | ||
| errorMessage?: string; | ||
| /** Error stack trace if failed */ | ||
| errorStack?: string; | ||
| /** Attachments (required, empty array if none) */ | ||
| attachments: Attachment[]; | ||
| /** Step results (required, always populated via fallback rules) */ | ||
| stepResults: StepResult[]; | ||
| /** Full title path from suite/describe blocks (required, empty array if none) */ | ||
| titlePath: string[]; | ||
| /** Playwright project name (optional) */ | ||
| projectName?: string; | ||
| /** Retry attempt number (required, default 0) */ | ||
| retry: number; | ||
| /** Total retries configured (required, default 0) */ | ||
| retries: number; | ||
| /** Normalized tags from story (required, empty array if none) */ | ||
| tags: string[]; | ||
| /** All retry attempts (optional, includes details per attempt) */ | ||
| attempts?: TestCaseAttempt[]; | ||
| /** | ||
| * Ingested evidence (mutation/coverage/failing-first) used by the review | ||
| * formatter to grade proof strength. Populated at the ACL/ingestion layer, | ||
| * never by adapters. Optional and additive. | ||
| */ | ||
| evidence?: TestCaseEvidence; | ||
| } | ||
| /** | ||
| * Evidence ingested from external tools to harden the "the test passes" claim. | ||
| * | ||
| * Populated at the ACL/ingestion layer from the host project's own tooling | ||
| * (Stryker/PITest mutation runs, coverage reports, base-ref re-verification). | ||
| * The packages never RUN these tools — same ingestion shape as {@link StoryMeta.otelSpans}. | ||
| * Consumed by the review formatter to grade how credible a claim's proof is. | ||
| */ | ||
| interface TestCaseEvidence { | ||
| /** Mutation score (0-100) attributed to this test/file, from Stryker/PITest/etc. */ | ||
| mutationScorePct?: number; | ||
| /** Mutants killed by this test's covered code (when the tool reports it). */ | ||
| mutantsKilled?: number; | ||
| /** Total mutants in this test's covered code (when the tool reports it). */ | ||
| mutantsTotal?: number; | ||
| /** | ||
| * True when the test was verified red on the base ref and green on head | ||
| * (the failing-first regression lock for bugfixes). | ||
| */ | ||
| failingFirstVerified?: boolean; | ||
| /** Coverage of the changed lines this test exercises (0-100), when computable. */ | ||
| changedLineCoveragePct?: number; | ||
| } | ||
| /** CI environment info */ | ||
| interface CIInfo { | ||
| name: string; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| branch?: string; | ||
| commitSha?: string; | ||
| prNumber?: string; | ||
| } | ||
| /** Coverage summary for the test run */ | ||
| interface CoverageSummary { | ||
| /** Line coverage percentage (0-100) */ | ||
| linesPct?: number; | ||
| /** Branch coverage percentage (0-100) */ | ||
| branchesPct?: number; | ||
| /** Function coverage percentage (0-100) */ | ||
| functionsPct?: number; | ||
| /** Statement coverage percentage (0-100) */ | ||
| statementsPct?: number; | ||
| } | ||
| /** Canonical test run result */ | ||
| interface TestRunResult { | ||
| /** All test case results */ | ||
| testCases: TestCaseResult[]; | ||
| /** Run start time (epoch ms, required) */ | ||
| startedAtMs: number; | ||
| /** Run finish time (epoch ms, required) */ | ||
| finishedAtMs: number; | ||
| /** Total duration in milliseconds (required) */ | ||
| durationMs: number; | ||
| /** Project root directory (required) */ | ||
| projectRoot: string; | ||
| /** Unique run ID (required, generated) */ | ||
| runId: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git commit SHA */ | ||
| gitSha?: string; | ||
| /** CI environment info */ | ||
| ci?: CIInfo; | ||
| /** Coverage summary for the run */ | ||
| coverage?: CoverageSummary; | ||
| } | ||
| /** | ||
| * Jest Adapter - Layer 1. | ||
| * | ||
| * Transforms Jest test results and story reports into RawRun. | ||
| */ | ||
| /** Jest test result shape (subset of what Jest provides) */ | ||
| interface JestTestResult { | ||
| fullName: string; | ||
| status: "passed" | "failed" | "pending" | "todo"; | ||
| duration?: number; | ||
| failureMessages?: string[]; | ||
| } | ||
| /** Jest file result shape */ | ||
| interface JestFileResult { | ||
| testFilePath: string; | ||
| testResults: JestTestResult[]; | ||
| } | ||
| /** Jest aggregated result shape */ | ||
| interface JestAggregatedResult { | ||
| testResults: JestFileResult[]; | ||
| startTime?: number; | ||
| } | ||
| /** Story file report written by story.init() */ | ||
| interface StoryFileReport { | ||
| testFilePath: string; | ||
| scenarios: StoryMeta[]; | ||
| } | ||
| /** Options for Jest adapter */ | ||
| interface JestAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| } | ||
| /** | ||
| * Adapt Jest results and story reports to RawRun. | ||
| * | ||
| * @param jestResults - Jest aggregated results | ||
| * @param storyReports - Story reports from story.init() | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptJestRun(jestResults: JestAggregatedResult, storyReports: StoryFileReport[], options?: JestAdapterOptions): RawRun; | ||
| /** | ||
| * Vitest Adapter - Layer 1. | ||
| * | ||
| * Transforms Vitest test results into RawRun. | ||
| */ | ||
| /** Vitest test state */ | ||
| type VitestState = "passed" | "failed" | "skipped" | "pending"; | ||
| /** Vitest serialized error */ | ||
| interface VitestSerializedError { | ||
| message?: string; | ||
| stack?: string; | ||
| diff?: string; | ||
| } | ||
| /** Vitest test result shape */ | ||
| interface VitestTestResult { | ||
| state?: VitestState; | ||
| duration?: number; | ||
| errors?: VitestSerializedError[]; | ||
| } | ||
| /** Vitest test case shape (minimal) */ | ||
| interface VitestTestCase { | ||
| name: string; | ||
| meta: () => Record<string, unknown>; | ||
| result: () => VitestTestResult | undefined; | ||
| } | ||
| /** Vitest test module shape (minimal) */ | ||
| interface VitestTestModule { | ||
| moduleId?: string; | ||
| relativeModuleId?: string; | ||
| children?: { | ||
| allTests: () => Iterable<VitestTestCase>; | ||
| }; | ||
| } | ||
| /** Options for Vitest adapter */ | ||
| interface VitestAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| /** Start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| } | ||
| /** | ||
| * Adapt Vitest test modules to RawRun. | ||
| * | ||
| * @param testModules - Vitest test modules | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptVitestRun(testModules: ReadonlyArray<VitestTestModule>, options?: VitestAdapterOptions): RawRun; | ||
| /** | ||
| * Playwright Adapter - Layer 1. | ||
| * | ||
| * Transforms Playwright test results into RawRun. | ||
| */ | ||
| /** Playwright test status */ | ||
| type PlaywrightStatus = "passed" | "failed" | "skipped" | "timedOut" | "interrupted"; | ||
| /** Playwright test error */ | ||
| interface PlaywrightError { | ||
| message?: string; | ||
| stack?: string; | ||
| } | ||
| /** Playwright attachment */ | ||
| interface PlaywrightAttachment { | ||
| name: string; | ||
| contentType: string; | ||
| path?: string; | ||
| body?: Buffer; | ||
| } | ||
| /** Playwright test result */ | ||
| interface PlaywrightTestResult { | ||
| status: PlaywrightStatus; | ||
| duration: number; | ||
| errors: PlaywrightError[]; | ||
| attachments: PlaywrightAttachment[]; | ||
| retry: number; | ||
| /** Optional step events if caller captures Playwright step timing. */ | ||
| stepEvents?: Array<{ | ||
| index?: number; | ||
| stepId?: string; | ||
| title?: string; | ||
| status?: RawStatus; | ||
| durationMs?: number; | ||
| errorMessage?: string; | ||
| }>; | ||
| } | ||
| /** Playwright test case annotation */ | ||
| interface PlaywrightAnnotation { | ||
| type: string; | ||
| description?: string; | ||
| } | ||
| /** Playwright test location */ | ||
| interface PlaywrightLocation { | ||
| file: string; | ||
| line: number; | ||
| column: number; | ||
| } | ||
| /** Playwright test case shape (minimal) */ | ||
| interface PlaywrightTestCase { | ||
| title: string; | ||
| titlePath: () => string[]; | ||
| annotations: PlaywrightAnnotation[]; | ||
| location: PlaywrightLocation; | ||
| retries: number; | ||
| } | ||
| /** Options for Playwright adapter */ | ||
| interface PlaywrightAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| /** Start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| /** Playwright project name */ | ||
| projectName?: string; | ||
| } | ||
| /** | ||
| * Adapt Playwright test results to RawRun. | ||
| * | ||
| * @param testResults - Array of [testCase, result] tuples | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun; | ||
| export { type Attachment as A, STORY_META_KEY as B, type CIInfo$1 as C, type DocEntry as D, type StepKeyword as E, type StepMode as F, type StoryFileReport as G, type StoryMeta as H, type TestCaseAttempt as I, type JestAdapterOptions as J, type TestCaseEvidence as K, type VitestSerializedError as L, type VitestState as M, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type VitestTestCase as Q, type RawStatus as R, type StoryStep as S, type TestRunResult as T, type VitestTestModule as U, type VitestAdapterOptions as V, type VitestTestResult as W, toCIInfo as X, toRawCIInfo as Y, type TestCaseResult as a, type TestStatus as b, type DocPhase as c, type StepResult as d, type CIProvider as e, type RawAttachment as f, type RawRun as g, type RawCIInfo as h, adaptJestRun as i, adaptPlaywrightRun as j, adaptVitestRun as k, type CIInfo as l, type CoverageSummary as m, type JestAggregatedResult as n, type JestFileResult as o, type JestTestResult as p, type OtelAttributeValue as q, type PlaywrightAnnotation as r, type PlaywrightAttachment as s, type PlaywrightError as t, type PlaywrightLocation as u, type PlaywrightStatus as v, type PlaywrightTestCase as w, type PlaywrightTestResult as x, type RawStepEvent as y, type RawTestCase as z }; |
| /** | ||
| * Typed CI provider and canonical CI info. | ||
| * | ||
| * RawCIInfo.name = legacy transport string (kept for backward compat + schema). | ||
| * CIInfo.displayName = canonical display name for downstream consumers. | ||
| * | ||
| * All downstream code (HTML meta, notifications, history) uses CIInfo via mappers. | ||
| */ | ||
| type CIProvider = "github" | "gitlab" | "circleci" | "jenkins" | "azure" | "buildkite" | "travis" | "unknown"; | ||
| interface CIInfo$1 { | ||
| provider: CIProvider; | ||
| displayName: string; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| branch?: string; | ||
| commitSha?: string; | ||
| prNumber?: string; | ||
| } | ||
| /** Convert RawCIInfo (legacy transport) to canonical CIInfo. */ | ||
| declare function toCIInfo(raw?: RawCIInfo): CIInfo$1 | undefined; | ||
| /** Convert canonical CIInfo back to RawCIInfo (for serialization). */ | ||
| declare function toRawCIInfo(ci?: CIInfo$1): RawCIInfo | undefined; | ||
| /** | ||
| * OTel span types for trace waterfall rendering. | ||
| * | ||
| * Structurally compatible with autotel's SerializedSpan | ||
| * and raw OTel nanosecond formats. No import dependency on autotel. | ||
| */ | ||
| type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[]; | ||
| interface OtelSpan { | ||
| spanId: string; | ||
| parentSpanId?: string; | ||
| name: string; | ||
| /** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */ | ||
| startTimeMs?: number; | ||
| durationMs?: number; | ||
| /** Compatibility: raw OTel nanosecond timestamps */ | ||
| startTimeUnixNano?: number; | ||
| endTimeUnixNano?: number; | ||
| status: "ok" | "error" | "unset"; | ||
| statusMessage?: string; | ||
| attributes?: Record<string, OtelAttributeValue>; | ||
| } | ||
| /** | ||
| * Story types — the shared vocabulary for all framework adapters. | ||
| * | ||
| * These types were previously in executable-stories-core. | ||
| * They now live in formatters so every adapter can import them | ||
| * from the same place that defines RawRun (the output contract). | ||
| */ | ||
| /** BDD step keywords for scenario documentation */ | ||
| type StepKeyword = "Given" | "When" | "Then" | "And" | "But"; | ||
| /** Step execution mode for docs rendering */ | ||
| type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent"; | ||
| /** Phase tracks when the doc entry was added */ | ||
| type DocPhase = "static" | "runtime"; | ||
| /** Union type for all documentation entry kinds */ | ||
| type DocEntry = { | ||
| kind: "note"; | ||
| text: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "tag"; | ||
| names: string[]; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "kv"; | ||
| label: string; | ||
| value: unknown; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "code"; | ||
| label: string; | ||
| content: string; | ||
| lang?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "table"; | ||
| label: string; | ||
| columns: string[]; | ||
| rows: string[][]; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "link"; | ||
| label: string; | ||
| url: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "section"; | ||
| title: string; | ||
| markdown: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "mermaid"; | ||
| code: string; | ||
| title?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "screenshot"; | ||
| path: string; | ||
| alt?: string; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| } | { | ||
| kind: "custom"; | ||
| type: string; | ||
| data: unknown; | ||
| phase: DocPhase; | ||
| children?: DocEntry[]; | ||
| }; | ||
| /** | ||
| * A single step in a scenario with its documentation entries. | ||
| */ | ||
| interface StoryStep { | ||
| /** Stable internal ID (auto-generated at creation, e.g., "step-0") */ | ||
| id?: string; | ||
| /** The BDD keyword (Given, When, Then, And, But) */ | ||
| keyword: StepKeyword; | ||
| /** The step description text */ | ||
| text: string; | ||
| /** Step execution mode for docs rendering */ | ||
| mode?: StepMode; | ||
| /** Rich documentation entries attached to this step */ | ||
| docs?: DocEntry[]; | ||
| /** Opt-in step duration in milliseconds */ | ||
| durationMs?: number; | ||
| /** Whether this step wrapped a function body (step.fn / step.step) vs a text marker */ | ||
| wrapped?: boolean; | ||
| } | ||
| /** A ticket reference with an optional direct URL */ | ||
| interface NormalizedTicket { | ||
| /** Ticket identifier (e.g., "JIRA-123", "PAY-1042") */ | ||
| id: string; | ||
| /** Direct URL to the ticket (overrides ticketUrlTemplate) */ | ||
| url?: string; | ||
| } | ||
| /** | ||
| * Metadata for a complete scenario, attached to test metadata. | ||
| * Used by reporters to generate documentation. | ||
| */ | ||
| interface StoryMeta { | ||
| /** The scenario title (from test name) */ | ||
| scenario: string; | ||
| /** All steps in this scenario */ | ||
| steps: StoryStep[]; | ||
| /** Tags for filtering and categorization */ | ||
| tags?: string[]; | ||
| /** Ticket/issue references (normalized to array) */ | ||
| tickets?: NormalizedTicket[]; | ||
| /** Product-code paths/globs this scenario exercises (project-root-relative). */ | ||
| covers?: string[]; | ||
| /** User-defined metadata */ | ||
| meta?: Record<string, unknown>; | ||
| /** Parent describe/suite names for hierarchical grouping */ | ||
| suitePath?: string[]; | ||
| /** Story-level docs (before any steps) */ | ||
| docs?: DocEntry[]; | ||
| /** Order in which story.init() was called (for source ordering) */ | ||
| sourceOrder?: number; | ||
| /** OTel spans from autotel for trace waterfall rendering */ | ||
| otelSpans?: OtelSpan[]; | ||
| } | ||
| /** Key used to store StoryMeta in test metadata */ | ||
| declare const STORY_META_KEY = "story"; | ||
| /** Permissive status from any framework */ | ||
| type RawStatus = "pass" | "fail" | "skip" | "todo" | "pending" | "timeout" | "interrupted" | "unknown"; | ||
| /** Raw attachment - don't decide inline vs link yet */ | ||
| interface RawAttachment { | ||
| name: string; | ||
| mediaType: string; | ||
| /** File reference (path on disk) */ | ||
| path?: string; | ||
| /** Inline content */ | ||
| body?: string; | ||
| /** Content encoding */ | ||
| encoding?: "BASE64" | "IDENTITY"; | ||
| /** Character set (default: "utf-8" when IDENTITY + text) */ | ||
| charset?: string; | ||
| /** Actual artifact name (distinct from logical label) */ | ||
| fileName?: string; | ||
| /** Size in bytes (for embed vs link decision) */ | ||
| byteLength?: number; | ||
| /** Step index (undefined = test-case level) */ | ||
| stepIndex?: number; | ||
| /** Stable step ID, preferred over stepIndex by converter */ | ||
| stepId?: string; | ||
| } | ||
| /** Raw step event from framework (if available) */ | ||
| interface RawStepEvent { | ||
| index?: number; | ||
| stepId?: string; | ||
| title?: string; | ||
| status?: RawStatus; | ||
| durationMs?: number; | ||
| errorMessage?: string; | ||
| } | ||
| /** Raw test case - best-effort data gathering */ | ||
| interface RawTestCase { | ||
| /** Framework's test ID */ | ||
| externalId?: string; | ||
| /** Test title/name */ | ||
| title?: string; | ||
| /** Full title path (describe blocks + test name) */ | ||
| titlePath?: string[]; | ||
| /** Story metadata from test */ | ||
| story?: StoryMeta; | ||
| /** Source file path */ | ||
| sourceFile?: string; | ||
| /** Source line number (1-based) */ | ||
| sourceLine?: number; | ||
| /** Test status */ | ||
| status: RawStatus; | ||
| /** Duration in milliseconds */ | ||
| durationMs?: number; | ||
| /** Error information */ | ||
| error?: { | ||
| message?: string; | ||
| stack?: string; | ||
| }; | ||
| /** Step-level info if framework provides it */ | ||
| stepEvents?: RawStepEvent[]; | ||
| /** Attachments (screenshots, logs, etc.) */ | ||
| attachments?: RawAttachment[]; | ||
| /** Framework-specific metadata (kept for debugging) */ | ||
| meta?: Record<string, unknown>; | ||
| /** | ||
| * Evidence ingested from external tools (mutation/coverage/failing-first). | ||
| * Not produced by framework adapters — injected at ingestion time and passed | ||
| * through to the canonical {@link TestCaseResult.evidence}. | ||
| */ | ||
| evidence?: TestCaseEvidence; | ||
| /** Retry attempt number (0-based) */ | ||
| retry?: number; | ||
| /** Total retry count configured */ | ||
| retries?: number; | ||
| /** Playwright project name */ | ||
| projectName?: string; | ||
| } | ||
| /** CI environment info */ | ||
| interface RawCIInfo { | ||
| name: string; | ||
| /** Typed provider key (stable identifier) */ | ||
| provider?: CIProvider; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| /** Git branch name */ | ||
| branch?: string; | ||
| /** Git commit SHA */ | ||
| commitSha?: string; | ||
| /** Pull/merge request number */ | ||
| prNumber?: string; | ||
| } | ||
| /** Raw run - all framework data gathered */ | ||
| interface RawRun { | ||
| /** All test cases from the run */ | ||
| testCases: RawTestCase[]; | ||
| /** Run start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| /** Run finish time (epoch ms) */ | ||
| finishedAtMs?: number; | ||
| /** Project root directory */ | ||
| projectRoot: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git commit SHA */ | ||
| gitSha?: string; | ||
| /** CI environment info */ | ||
| ci?: RawCIInfo; | ||
| } | ||
| /** Canonical test status (Cucumber-compatible) */ | ||
| type TestStatus = "passed" | "failed" | "skipped" | "pending"; | ||
| /** Step result with status and timing */ | ||
| interface StepResult { | ||
| /** Step index (0-based) */ | ||
| index: number; | ||
| /** Stable step ID when available */ | ||
| stepId?: string; | ||
| /** Step status */ | ||
| status: TestStatus; | ||
| /** Duration in milliseconds (default 0) */ | ||
| durationMs: number; | ||
| /** Error message if step failed */ | ||
| errorMessage?: string; | ||
| } | ||
| /** Resolved attachment (always has body) */ | ||
| interface Attachment { | ||
| /** Attachment name */ | ||
| name: string; | ||
| /** MIME type */ | ||
| mediaType: string; | ||
| /** Content (base64-encoded or URL) */ | ||
| body: string; | ||
| /** Content encoding */ | ||
| contentEncoding: "BASE64" | "IDENTITY"; | ||
| } | ||
| /** Single test attempt for retry tracking */ | ||
| interface TestCaseAttempt { | ||
| /** Attempt number (0-based) */ | ||
| attempt: number; | ||
| /** Status of this attempt */ | ||
| status: TestStatus; | ||
| /** Duration of this attempt in milliseconds */ | ||
| durationMs: number; | ||
| /** Error message if this attempt failed */ | ||
| errorMessage?: string; | ||
| /** Error stack trace if this attempt failed */ | ||
| errorStack?: string; | ||
| } | ||
| /** Canonical test case result */ | ||
| interface TestCaseResult { | ||
| /** Unique deterministic ID */ | ||
| id: string; | ||
| /** Story metadata (required) */ | ||
| story: StoryMeta; | ||
| /** Source file path (required) */ | ||
| sourceFile: string; | ||
| /** Source line number (required, default 1) */ | ||
| sourceLine: number; | ||
| /** Test status (required) */ | ||
| status: TestStatus; | ||
| /** Original adapter/framework status (preserved for diagnostics). */ | ||
| rawStatus?: RawStatus; | ||
| /** Duration in milliseconds (required, default 0) */ | ||
| durationMs: number; | ||
| /** Error message if failed */ | ||
| errorMessage?: string; | ||
| /** Error stack trace if failed */ | ||
| errorStack?: string; | ||
| /** Attachments (required, empty array if none) */ | ||
| attachments: Attachment[]; | ||
| /** Step results (required, always populated via fallback rules) */ | ||
| stepResults: StepResult[]; | ||
| /** Full title path from suite/describe blocks (required, empty array if none) */ | ||
| titlePath: string[]; | ||
| /** Playwright project name (optional) */ | ||
| projectName?: string; | ||
| /** Retry attempt number (required, default 0) */ | ||
| retry: number; | ||
| /** Total retries configured (required, default 0) */ | ||
| retries: number; | ||
| /** Normalized tags from story (required, empty array if none) */ | ||
| tags: string[]; | ||
| /** All retry attempts (optional, includes details per attempt) */ | ||
| attempts?: TestCaseAttempt[]; | ||
| /** | ||
| * Ingested evidence (mutation/coverage/failing-first) used by the review | ||
| * formatter to grade proof strength. Populated at the ACL/ingestion layer, | ||
| * never by adapters. Optional and additive. | ||
| */ | ||
| evidence?: TestCaseEvidence; | ||
| } | ||
| /** | ||
| * Evidence ingested from external tools to harden the "the test passes" claim. | ||
| * | ||
| * Populated at the ACL/ingestion layer from the host project's own tooling | ||
| * (Stryker/PITest mutation runs, coverage reports, base-ref re-verification). | ||
| * The packages never RUN these tools — same ingestion shape as {@link StoryMeta.otelSpans}. | ||
| * Consumed by the review formatter to grade how credible a claim's proof is. | ||
| */ | ||
| interface TestCaseEvidence { | ||
| /** Mutation score (0-100) attributed to this test/file, from Stryker/PITest/etc. */ | ||
| mutationScorePct?: number; | ||
| /** Mutants killed by this test's covered code (when the tool reports it). */ | ||
| mutantsKilled?: number; | ||
| /** Total mutants in this test's covered code (when the tool reports it). */ | ||
| mutantsTotal?: number; | ||
| /** | ||
| * True when the test was verified red on the base ref and green on head | ||
| * (the failing-first regression lock for bugfixes). | ||
| */ | ||
| failingFirstVerified?: boolean; | ||
| /** Coverage of the changed lines this test exercises (0-100), when computable. */ | ||
| changedLineCoveragePct?: number; | ||
| } | ||
| /** CI environment info */ | ||
| interface CIInfo { | ||
| name: string; | ||
| url?: string; | ||
| buildNumber?: string; | ||
| branch?: string; | ||
| commitSha?: string; | ||
| prNumber?: string; | ||
| } | ||
| /** Coverage summary for the test run */ | ||
| interface CoverageSummary { | ||
| /** Line coverage percentage (0-100) */ | ||
| linesPct?: number; | ||
| /** Branch coverage percentage (0-100) */ | ||
| branchesPct?: number; | ||
| /** Function coverage percentage (0-100) */ | ||
| functionsPct?: number; | ||
| /** Statement coverage percentage (0-100) */ | ||
| statementsPct?: number; | ||
| } | ||
| /** Canonical test run result */ | ||
| interface TestRunResult { | ||
| /** All test case results */ | ||
| testCases: TestCaseResult[]; | ||
| /** Run start time (epoch ms, required) */ | ||
| startedAtMs: number; | ||
| /** Run finish time (epoch ms, required) */ | ||
| finishedAtMs: number; | ||
| /** Total duration in milliseconds (required) */ | ||
| durationMs: number; | ||
| /** Project root directory (required) */ | ||
| projectRoot: string; | ||
| /** Unique run ID (required, generated) */ | ||
| runId: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git commit SHA */ | ||
| gitSha?: string; | ||
| /** CI environment info */ | ||
| ci?: CIInfo; | ||
| /** Coverage summary for the run */ | ||
| coverage?: CoverageSummary; | ||
| } | ||
| /** | ||
| * Jest Adapter - Layer 1. | ||
| * | ||
| * Transforms Jest test results and story reports into RawRun. | ||
| */ | ||
| /** Jest test result shape (subset of what Jest provides) */ | ||
| interface JestTestResult { | ||
| fullName: string; | ||
| status: "passed" | "failed" | "pending" | "todo"; | ||
| duration?: number; | ||
| failureMessages?: string[]; | ||
| } | ||
| /** Jest file result shape */ | ||
| interface JestFileResult { | ||
| testFilePath: string; | ||
| testResults: JestTestResult[]; | ||
| } | ||
| /** Jest aggregated result shape */ | ||
| interface JestAggregatedResult { | ||
| testResults: JestFileResult[]; | ||
| startTime?: number; | ||
| } | ||
| /** Story file report written by story.init() */ | ||
| interface StoryFileReport { | ||
| testFilePath: string; | ||
| scenarios: StoryMeta[]; | ||
| } | ||
| /** Options for Jest adapter */ | ||
| interface JestAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| } | ||
| /** | ||
| * Adapt Jest results and story reports to RawRun. | ||
| * | ||
| * @param jestResults - Jest aggregated results | ||
| * @param storyReports - Story reports from story.init() | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptJestRun(jestResults: JestAggregatedResult, storyReports: StoryFileReport[], options?: JestAdapterOptions): RawRun; | ||
| /** | ||
| * Vitest Adapter - Layer 1. | ||
| * | ||
| * Transforms Vitest test results into RawRun. | ||
| */ | ||
| /** Vitest test state */ | ||
| type VitestState = "passed" | "failed" | "skipped" | "pending"; | ||
| /** Vitest serialized error */ | ||
| interface VitestSerializedError { | ||
| message?: string; | ||
| stack?: string; | ||
| diff?: string; | ||
| } | ||
| /** Vitest test result shape */ | ||
| interface VitestTestResult { | ||
| state?: VitestState; | ||
| duration?: number; | ||
| errors?: VitestSerializedError[]; | ||
| } | ||
| /** Vitest test case shape (minimal) */ | ||
| interface VitestTestCase { | ||
| name: string; | ||
| meta: () => Record<string, unknown>; | ||
| result: () => VitestTestResult | undefined; | ||
| } | ||
| /** Vitest test module shape (minimal) */ | ||
| interface VitestTestModule { | ||
| moduleId?: string; | ||
| relativeModuleId?: string; | ||
| children?: { | ||
| allTests: () => Iterable<VitestTestCase>; | ||
| }; | ||
| } | ||
| /** Options for Vitest adapter */ | ||
| interface VitestAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| /** Start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| } | ||
| /** | ||
| * Adapt Vitest test modules to RawRun. | ||
| * | ||
| * @param testModules - Vitest test modules | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptVitestRun(testModules: ReadonlyArray<VitestTestModule>, options?: VitestAdapterOptions): RawRun; | ||
| /** | ||
| * Playwright Adapter - Layer 1. | ||
| * | ||
| * Transforms Playwright test results into RawRun. | ||
| */ | ||
| /** Playwright test status */ | ||
| type PlaywrightStatus = "passed" | "failed" | "skipped" | "timedOut" | "interrupted"; | ||
| /** Playwright test error */ | ||
| interface PlaywrightError { | ||
| message?: string; | ||
| stack?: string; | ||
| } | ||
| /** Playwright attachment */ | ||
| interface PlaywrightAttachment { | ||
| name: string; | ||
| contentType: string; | ||
| path?: string; | ||
| body?: Buffer; | ||
| } | ||
| /** Playwright test result */ | ||
| interface PlaywrightTestResult { | ||
| status: PlaywrightStatus; | ||
| duration: number; | ||
| errors: PlaywrightError[]; | ||
| attachments: PlaywrightAttachment[]; | ||
| retry: number; | ||
| /** Optional step events if caller captures Playwright step timing. */ | ||
| stepEvents?: Array<{ | ||
| index?: number; | ||
| stepId?: string; | ||
| title?: string; | ||
| status?: RawStatus; | ||
| durationMs?: number; | ||
| errorMessage?: string; | ||
| }>; | ||
| } | ||
| /** Playwright test case annotation */ | ||
| interface PlaywrightAnnotation { | ||
| type: string; | ||
| description?: string; | ||
| } | ||
| /** Playwright test location */ | ||
| interface PlaywrightLocation { | ||
| file: string; | ||
| line: number; | ||
| column: number; | ||
| } | ||
| /** Playwright test case shape (minimal) */ | ||
| interface PlaywrightTestCase { | ||
| title: string; | ||
| titlePath: () => string[]; | ||
| annotations: PlaywrightAnnotation[]; | ||
| location: PlaywrightLocation; | ||
| retries: number; | ||
| } | ||
| /** Options for Playwright adapter */ | ||
| interface PlaywrightAdapterOptions { | ||
| /** Project root directory */ | ||
| projectRoot?: string; | ||
| /** Package version */ | ||
| packageVersion?: string; | ||
| /** Git SHA */ | ||
| gitSha?: string; | ||
| /** Start time (epoch ms) */ | ||
| startedAtMs?: number; | ||
| /** Playwright project name */ | ||
| projectName?: string; | ||
| } | ||
| /** | ||
| * Adapt Playwright test results to RawRun. | ||
| * | ||
| * @param testResults - Array of [testCase, result] tuples | ||
| * @param options - Adapter options | ||
| * @returns RawRun for ACL processing | ||
| */ | ||
| declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun; | ||
| export { type Attachment as A, STORY_META_KEY as B, type CIInfo$1 as C, type DocEntry as D, type StepKeyword as E, type StepMode as F, type StoryFileReport as G, type StoryMeta as H, type TestCaseAttempt as I, type JestAdapterOptions as J, type TestCaseEvidence as K, type VitestSerializedError as L, type VitestState as M, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type VitestTestCase as Q, type RawStatus as R, type StoryStep as S, type TestRunResult as T, type VitestTestModule as U, type VitestAdapterOptions as V, type VitestTestResult as W, toCIInfo as X, toRawCIInfo as Y, type TestCaseResult as a, type TestStatus as b, type DocPhase as c, type StepResult as d, type CIProvider as e, type RawAttachment as f, type RawRun as g, type RawCIInfo as h, adaptJestRun as i, adaptPlaywrightRun as j, adaptVitestRun as k, type CIInfo as l, type CoverageSummary as m, type JestAggregatedResult as n, type JestFileResult as o, type JestTestResult as p, type OtelAttributeValue as q, type PlaywrightAnnotation as r, type PlaywrightAttachment as s, type PlaywrightError as t, type PlaywrightLocation as u, type PlaywrightStatus as v, type PlaywrightTestCase as w, type PlaywrightTestResult as x, type RawStepEvent as y, type RawTestCase as z }; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
5728211
2.66%68032
1.92%298
13.31%67
-4.29%4
33.33%234
1.74%+ Added
+ Added