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 { | ||
| 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 | undefined; | ||
| /** Convert canonical CIInfo back to RawCIInfo (for serialization). */ | ||
| declare function toRawCIInfo(ci?: CIInfo): 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[]; | ||
| /** 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>; | ||
| /** 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; | ||
| } | ||
| /** | ||
| * 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 VitestSerializedError as A, type VitestState as B, type CIInfo as C, type DocEntry as D, type VitestTestCase as E, type VitestTestModule as F, type VitestTestResult as G, toCIInfo as H, toRawCIInfo as I, type JestAdapterOptions as J, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type RawStatus as R, type StoryMeta as S, type VitestAdapterOptions as V, type StoryStep as a, type CIProvider as b, type RawAttachment as c, type RawRun as d, type RawCIInfo as e, adaptJestRun as f, adaptPlaywrightRun as g, adaptVitestRun as h, type DocPhase as i, type JestAggregatedResult as j, type JestFileResult as k, type JestTestResult as l, type OtelAttributeValue as m, type PlaywrightAnnotation as n, type PlaywrightAttachment as o, type PlaywrightError as p, type PlaywrightLocation as q, type PlaywrightStatus as r, type PlaywrightTestCase as s, type PlaywrightTestResult as t, type RawStepEvent as u, type RawTestCase as v, STORY_META_KEY as w, type StepKeyword as x, type StepMode as y, type StoryFileReport 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 { | ||
| 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 | undefined; | ||
| /** Convert canonical CIInfo back to RawCIInfo (for serialization). */ | ||
| declare function toRawCIInfo(ci?: CIInfo): 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[]; | ||
| /** 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>; | ||
| /** 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; | ||
| } | ||
| /** | ||
| * 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 VitestSerializedError as A, type VitestState as B, type CIInfo as C, type DocEntry as D, type VitestTestCase as E, type VitestTestModule as F, type VitestTestResult as G, toCIInfo as H, toRawCIInfo as I, type JestAdapterOptions as J, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type RawStatus as R, type StoryMeta as S, type VitestAdapterOptions as V, type StoryStep as a, type CIProvider as b, type RawAttachment as c, type RawRun as d, type RawCIInfo as e, adaptJestRun as f, adaptPlaywrightRun as g, adaptVitestRun as h, type DocPhase as i, type JestAggregatedResult as j, type JestFileResult as k, type JestTestResult as l, type OtelAttributeValue as m, type PlaywrightAnnotation as n, type PlaywrightAttachment as o, type PlaywrightError as p, type PlaywrightLocation as q, type PlaywrightStatus as r, type PlaywrightTestCase as s, type PlaywrightTestResult as t, type RawStepEvent as u, type RawTestCase as v, STORY_META_KEY as w, type StepKeyword as x, type StepMode as y, type StoryFileReport as z }; |
@@ -252,2 +252,10 @@ "use strict"; | ||
| } : void 0; | ||
| const stepEvents = result.stepEvents?.length ? result.stepEvents : story.steps.map( | ||
| (step, index) => step.durationMs !== void 0 ? { | ||
| index, | ||
| stepId: step.id, | ||
| title: step.text, | ||
| durationMs: step.durationMs | ||
| } : void 0 | ||
| ).filter((e) => e !== void 0); | ||
| testCases.push({ | ||
@@ -263,4 +271,3 @@ externalId: test.titlePath().join(" > "), | ||
| error, | ||
| stepEvents: void 0, | ||
| // Playwright could provide step info, but we don't capture it yet | ||
| stepEvents: stepEvents.length > 0 ? stepEvents : void 0, | ||
| attachments, | ||
@@ -267,0 +274,0 @@ meta: { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/converters/adapters/index.ts","../src/converters/adapters/jest.ts","../src/converters/adapters/vitest.ts","../src/converters/adapters/playwright.ts"],"sourcesContent":["/**\n * Framework adapters - Layer 1.\n *\n * Transform framework-specific data to RawRun for ACL processing.\n */\n\nexport {\n adaptJestRun,\n type JestTestResult,\n type JestFileResult,\n type JestAggregatedResult,\n type StoryFileReport,\n type JestAdapterOptions,\n} from \"./jest\";\n\nexport {\n adaptVitestRun,\n type VitestState,\n type VitestSerializedError,\n type VitestTestResult,\n type VitestTestCase,\n type VitestTestModule,\n type VitestAdapterOptions,\n} from \"./vitest\";\n\nexport {\n adaptPlaywrightRun,\n type PlaywrightStatus,\n type PlaywrightError,\n type PlaywrightAttachment,\n type PlaywrightTestResult,\n type PlaywrightAnnotation,\n type PlaywrightLocation,\n type PlaywrightTestCase,\n type PlaywrightAdapterOptions,\n} from \"./playwright\";\n","/**\n * Jest Adapter - Layer 1.\n *\n * Transforms Jest test results and story reports into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"../../types/raw\";\n\n/** Jest test result shape (subset of what Jest provides) */\nexport interface JestTestResult {\n fullName: string;\n status: \"passed\" | \"failed\" | \"pending\" | \"todo\";\n duration?: number;\n failureMessages?: string[];\n}\n\n/** Jest file result shape */\nexport interface JestFileResult {\n testFilePath: string;\n testResults: JestTestResult[];\n}\n\n/** Jest aggregated result shape */\nexport interface JestAggregatedResult {\n testResults: JestFileResult[];\n startTime?: number;\n}\n\n/** Story file report written by story.init() */\nexport interface StoryFileReport {\n testFilePath: string;\n scenarios: StoryMeta[];\n}\n\n/** Options for Jest adapter */\nexport interface JestAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n}\n\n/**\n * Map Jest status to RawStatus.\n */\nfunction mapJestStatus(status: JestTestResult[\"status\"]): RawStatus {\n switch (status) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"pending\":\n return \"pending\";\n case \"todo\":\n return \"todo\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Jest results and story reports to RawRun.\n *\n * @param jestResults - Jest aggregated results\n * @param storyReports - Story reports from story.init()\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptJestRun(\n jestResults: JestAggregatedResult,\n storyReports: StoryFileReport[],\n options: JestAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n\n // Build map of Jest results by file for lookup\n const fileResultsMap = new Map<string, JestFileResult>();\n for (const fileResult of jestResults.testResults) {\n fileResultsMap.set(fileResult.testFilePath, fileResult);\n }\n\n // Process each story report\n for (const report of storyReports) {\n const fileResult = fileResultsMap.get(report.testFilePath);\n\n for (const meta of report.scenarios) {\n if (!meta?.scenario) continue;\n\n // Find matching Jest test result\n const matchingTest = findMatchingJestTest(fileResult, meta);\n\n testCases.push({\n externalId: matchingTest?.fullName,\n title: meta.scenario,\n titlePath: meta.suitePath\n ? [...meta.suitePath, meta.scenario]\n : [meta.scenario],\n story: meta,\n sourceFile: report.testFilePath,\n sourceLine: undefined, // Jest doesn't provide line numbers\n status: matchingTest ? mapJestStatus(matchingTest.status) : \"unknown\",\n durationMs: matchingTest?.duration,\n error: matchingTest?.failureMessages?.length\n ? { message: matchingTest.failureMessages.join(\"\\n\") }\n : undefined,\n stepEvents: undefined, // Jest doesn't provide step-level results\n attachments: undefined, // Jest doesn't capture attachments\n meta: { jestStatus: matchingTest?.status },\n retry: 0,\n retries: 0,\n projectName: undefined,\n });\n }\n }\n\n return {\n testCases,\n startedAtMs: jestResults.startTime,\n finishedAtMs: Date.now(),\n projectRoot: options.projectRoot ?? process.cwd(),\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Find matching Jest test result for a story.\n *\n * Matches by constructing fullName from suitePath and scenario.\n */\nfunction findMatchingJestTest(\n fileResult: JestFileResult | undefined,\n meta: StoryMeta\n): JestTestResult | undefined {\n if (!fileResult) return undefined;\n\n // Construct expected fullName\n const expectedFullName = meta.suitePath\n ? [...meta.suitePath, meta.scenario].join(\" > \")\n : meta.scenario;\n\n return fileResult.testResults.find((test) => test.fullName === expectedFullName);\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n","/**\n * Vitest Adapter - Layer 1.\n *\n * Transforms Vitest test results into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"../../types/raw\";\n\n/** Vitest test state */\nexport type VitestState = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\n/** Vitest serialized error */\nexport interface VitestSerializedError {\n message?: string;\n stack?: string;\n diff?: string;\n}\n\n/** Vitest test result shape */\nexport interface VitestTestResult {\n state?: VitestState;\n duration?: number;\n errors?: VitestSerializedError[];\n}\n\n/** Vitest test case shape (minimal) */\nexport interface VitestTestCase {\n name: string;\n meta: () => Record<string, unknown>;\n result: () => VitestTestResult | undefined;\n}\n\n/** Vitest test module shape (minimal) */\nexport interface VitestTestModule {\n moduleId?: string;\n relativeModuleId?: string;\n children?: {\n allTests: () => Iterable<VitestTestCase>;\n };\n}\n\n/** Options for Vitest adapter */\nexport interface VitestAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n /** Start time (epoch ms) */\n startedAtMs?: number;\n}\n\n/**\n * Map Vitest state to RawStatus.\n */\nfunction mapVitestStatus(state?: VitestState): RawStatus {\n switch (state) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"skipped\":\n return \"skip\";\n case \"pending\":\n return \"pending\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Vitest test modules to RawRun.\n *\n * @param testModules - Vitest test modules\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptVitestRun(\n testModules: ReadonlyArray<VitestTestModule>,\n options: VitestAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n const projectRoot = options.projectRoot ?? process.cwd();\n\n for (const mod of testModules) {\n const collection = mod.children;\n if (!collection) continue;\n\n // Get module path\n const moduleId = mod.moduleId ?? mod.relativeModuleId ?? \"\";\n const sourcePath = moduleId.startsWith(\"/\")\n ? moduleId\n : `${projectRoot}/${moduleId}`;\n\n for (const test of collection.allTests()) {\n const meta = test.meta();\n const story = meta?.[\"story\"] as StoryMeta | undefined;\n\n if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n const result = test.result();\n const state = result?.state;\n const errors = state === \"failed\" && result ? result.errors : undefined;\n\n testCases.push({\n externalId: test.name,\n title: story.scenario,\n titlePath: story.suitePath\n ? [...story.suitePath, story.scenario]\n : [story.scenario],\n story,\n sourceFile: sourcePath,\n sourceLine: undefined, // Vitest doesn't provide line numbers easily\n status: mapVitestStatus(state),\n durationMs: result?.duration,\n error: errors?.length\n ? {\n message: formatVitestError(errors[0]),\n stack: errors[0].stack,\n }\n : undefined,\n stepEvents: undefined, // Vitest doesn't provide step-level results\n attachments: undefined, // Vitest doesn't capture attachments\n meta: { vitestState: state },\n retry: 0,\n retries: 0,\n projectName: undefined,\n });\n }\n }\n\n return {\n testCases,\n startedAtMs: options.startedAtMs,\n finishedAtMs: Date.now(),\n projectRoot,\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Format Vitest error message.\n */\nfunction formatVitestError(error: VitestSerializedError): string {\n const parts: string[] = [];\n\n if (error.message) {\n parts.push(error.message);\n }\n\n if (error.diff) {\n parts.push(\"\", error.diff);\n }\n\n return parts.join(\"\\n\") || \"Unknown error\";\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n","/**\n * Playwright Adapter - Layer 1.\n *\n * Transforms Playwright test results into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus, RawAttachment } from \"../../types/raw\";\n\n/** Playwright test status */\nexport type PlaywrightStatus =\n | \"passed\"\n | \"failed\"\n | \"skipped\"\n | \"timedOut\"\n | \"interrupted\";\n\n/** Playwright test error */\nexport interface PlaywrightError {\n message?: string;\n stack?: string;\n}\n\n/** Playwright attachment */\nexport interface PlaywrightAttachment {\n name: string;\n contentType: string;\n path?: string;\n body?: Buffer;\n}\n\n/** Playwright test result */\nexport interface PlaywrightTestResult {\n status: PlaywrightStatus;\n duration: number;\n errors: PlaywrightError[];\n attachments: PlaywrightAttachment[];\n retry: number;\n}\n\n/** Playwright test case annotation */\nexport interface PlaywrightAnnotation {\n type: string;\n description?: string;\n}\n\n/** Playwright test location */\nexport interface PlaywrightLocation {\n file: string;\n line: number;\n column: number;\n}\n\n/** Playwright test case shape (minimal) */\nexport interface PlaywrightTestCase {\n title: string;\n titlePath: () => string[];\n annotations: PlaywrightAnnotation[];\n location: PlaywrightLocation;\n retries: number;\n}\n\n/** Options for Playwright adapter */\nexport interface PlaywrightAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n /** Start time (epoch ms) */\n startedAtMs?: number;\n /** Playwright project name */\n projectName?: string;\n}\n\n/**\n * Map Playwright status to RawStatus.\n */\nfunction mapPlaywrightStatus(status: PlaywrightStatus): RawStatus {\n switch (status) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"skipped\":\n return \"skip\";\n case \"timedOut\":\n return \"timeout\";\n case \"interrupted\":\n return \"interrupted\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Playwright test results to RawRun.\n *\n * @param testResults - Array of [testCase, result] tuples\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptPlaywrightRun(\n testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>,\n options: PlaywrightAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n const projectRoot = options.projectRoot ?? process.cwd();\n\n for (const [test, result] of testResults) {\n // Find story-meta annotation\n const storyAnnotation = test.annotations.find((a) => a.type === \"story-meta\");\n if (!storyAnnotation?.description) continue;\n\n let story: StoryMeta;\n try {\n story = JSON.parse(storyAnnotation.description);\n } catch {\n continue; // Skip if annotation is not valid JSON\n }\n\n if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n // Convert attachments\n const attachments = convertAttachments(result.attachments);\n\n // Get error info\n const error = result.errors?.length\n ? {\n message: result.errors[0].message,\n stack: result.errors[0].stack,\n }\n : undefined;\n\n testCases.push({\n externalId: test.titlePath().join(\" > \"),\n title: story.scenario,\n titlePath: test.titlePath(),\n story,\n sourceFile: test.location.file,\n sourceLine: test.location.line,\n status: mapPlaywrightStatus(result.status),\n durationMs: result.duration,\n error,\n stepEvents: undefined, // Playwright could provide step info, but we don't capture it yet\n attachments,\n meta: {\n playwrightStatus: result.status,\n column: test.location.column,\n },\n retry: result.retry,\n retries: test.retries,\n projectName: options.projectName,\n });\n }\n\n return {\n testCases,\n startedAtMs: options.startedAtMs,\n finishedAtMs: Date.now(),\n projectRoot,\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Convert Playwright attachments to raw attachments.\n */\nfunction convertAttachments(\n attachments: PlaywrightAttachment[]\n): RawAttachment[] {\n return attachments.map((att) => ({\n name: att.name,\n mediaType: att.contentType,\n path: att.path,\n body: att.body ? att.body.toString(\"base64\") : undefined,\n encoding: att.body ? \"BASE64\" as const : undefined,\n byteLength: att.body?.length,\n }));\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgDA,SAAS,cAAc,QAA6C;AAClE,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAUO,SAAS,aACd,aACA,cACA,UAA8B,CAAC,GACvB;AACR,QAAM,YAA2B,CAAC;AAGlC,QAAM,iBAAiB,oBAAI,IAA4B;AACvD,aAAW,cAAc,YAAY,aAAa;AAChD,mBAAe,IAAI,WAAW,cAAc,UAAU;AAAA,EACxD;AAGA,aA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AAA,EACF;AAEA,MAAI,QAAQ,IAAI,aAAa;AAC3B,WAAO;AAAA,MACL,MAAM;AAAA,MACN,KAAK,QAAQ,IAAI;AAAA,MACjB,aAAa,QAAQ,IAAI;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,QAAQ,IAAI,IAAI;AAClB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,KAAK;AAAA,MACL,aAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":["detectCI","detectCI"]} | ||
| {"version":3,"sources":["../src/converters/adapters/index.ts","../src/converters/adapters/jest.ts","../src/converters/adapters/vitest.ts","../src/converters/adapters/playwright.ts"],"sourcesContent":["/**\n * Framework adapters - Layer 1.\n *\n * Transform framework-specific data to RawRun for ACL processing.\n */\n\nexport {\n adaptJestRun,\n type JestTestResult,\n type JestFileResult,\n type JestAggregatedResult,\n type StoryFileReport,\n type JestAdapterOptions,\n} from \"./jest\";\n\nexport {\n adaptVitestRun,\n type VitestState,\n type VitestSerializedError,\n type VitestTestResult,\n type VitestTestCase,\n type VitestTestModule,\n type VitestAdapterOptions,\n} from \"./vitest\";\n\nexport {\n adaptPlaywrightRun,\n type PlaywrightStatus,\n type PlaywrightError,\n type PlaywrightAttachment,\n type PlaywrightTestResult,\n type PlaywrightAnnotation,\n type PlaywrightLocation,\n type PlaywrightTestCase,\n type PlaywrightAdapterOptions,\n} from \"./playwright\";\n","/**\n * Jest Adapter - Layer 1.\n *\n * Transforms Jest test results and story reports into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"../../types/raw\";\n\n/** Jest test result shape (subset of what Jest provides) */\nexport interface JestTestResult {\n fullName: string;\n status: \"passed\" | \"failed\" | \"pending\" | \"todo\";\n duration?: number;\n failureMessages?: string[];\n}\n\n/** Jest file result shape */\nexport interface JestFileResult {\n testFilePath: string;\n testResults: JestTestResult[];\n}\n\n/** Jest aggregated result shape */\nexport interface JestAggregatedResult {\n testResults: JestFileResult[];\n startTime?: number;\n}\n\n/** Story file report written by story.init() */\nexport interface StoryFileReport {\n testFilePath: string;\n scenarios: StoryMeta[];\n}\n\n/** Options for Jest adapter */\nexport interface JestAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n}\n\n/**\n * Map Jest status to RawStatus.\n */\nfunction mapJestStatus(status: JestTestResult[\"status\"]): RawStatus {\n switch (status) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"pending\":\n return \"pending\";\n case \"todo\":\n return \"todo\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Jest results and story reports to RawRun.\n *\n * @param jestResults - Jest aggregated results\n * @param storyReports - Story reports from story.init()\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptJestRun(\n jestResults: JestAggregatedResult,\n storyReports: StoryFileReport[],\n options: JestAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n\n // Build map of Jest results by file for lookup\n const fileResultsMap = new Map<string, JestFileResult>();\n for (const fileResult of jestResults.testResults) {\n fileResultsMap.set(fileResult.testFilePath, fileResult);\n }\n\n // Process each story report\n for (const report of storyReports) {\n const fileResult = fileResultsMap.get(report.testFilePath);\n\n for (const meta of report.scenarios) {\n if (!meta?.scenario) continue;\n\n // Find matching Jest test result\n const matchingTest = findMatchingJestTest(fileResult, meta);\n\n testCases.push({\n externalId: matchingTest?.fullName,\n title: meta.scenario,\n titlePath: meta.suitePath\n ? [...meta.suitePath, meta.scenario]\n : [meta.scenario],\n story: meta,\n sourceFile: report.testFilePath,\n sourceLine: undefined, // Jest doesn't provide line numbers\n status: matchingTest ? mapJestStatus(matchingTest.status) : \"unknown\",\n durationMs: matchingTest?.duration,\n error: matchingTest?.failureMessages?.length\n ? { message: matchingTest.failureMessages.join(\"\\n\") }\n : undefined,\n stepEvents: undefined, // Jest doesn't provide step-level results\n attachments: undefined, // Jest doesn't capture attachments\n meta: { jestStatus: matchingTest?.status },\n retry: 0,\n retries: 0,\n projectName: undefined,\n });\n }\n }\n\n return {\n testCases,\n startedAtMs: jestResults.startTime,\n finishedAtMs: Date.now(),\n projectRoot: options.projectRoot ?? process.cwd(),\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Find matching Jest test result for a story.\n *\n * Matches by constructing fullName from suitePath and scenario.\n */\nfunction findMatchingJestTest(\n fileResult: JestFileResult | undefined,\n meta: StoryMeta\n): JestTestResult | undefined {\n if (!fileResult) return undefined;\n\n // Construct expected fullName\n const expectedFullName = meta.suitePath\n ? [...meta.suitePath, meta.scenario].join(\" > \")\n : meta.scenario;\n\n return fileResult.testResults.find((test) => test.fullName === expectedFullName);\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n","/**\n * Vitest Adapter - Layer 1.\n *\n * Transforms Vitest test results into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"../../types/raw\";\n\n/** Vitest test state */\nexport type VitestState = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\n/** Vitest serialized error */\nexport interface VitestSerializedError {\n message?: string;\n stack?: string;\n diff?: string;\n}\n\n/** Vitest test result shape */\nexport interface VitestTestResult {\n state?: VitestState;\n duration?: number;\n errors?: VitestSerializedError[];\n}\n\n/** Vitest test case shape (minimal) */\nexport interface VitestTestCase {\n name: string;\n meta: () => Record<string, unknown>;\n result: () => VitestTestResult | undefined;\n}\n\n/** Vitest test module shape (minimal) */\nexport interface VitestTestModule {\n moduleId?: string;\n relativeModuleId?: string;\n children?: {\n allTests: () => Iterable<VitestTestCase>;\n };\n}\n\n/** Options for Vitest adapter */\nexport interface VitestAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n /** Start time (epoch ms) */\n startedAtMs?: number;\n}\n\n/**\n * Map Vitest state to RawStatus.\n */\nfunction mapVitestStatus(state?: VitestState): RawStatus {\n switch (state) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"skipped\":\n return \"skip\";\n case \"pending\":\n return \"pending\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Vitest test modules to RawRun.\n *\n * @param testModules - Vitest test modules\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptVitestRun(\n testModules: ReadonlyArray<VitestTestModule>,\n options: VitestAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n const projectRoot = options.projectRoot ?? process.cwd();\n\n for (const mod of testModules) {\n const collection = mod.children;\n if (!collection) continue;\n\n // Get module path\n const moduleId = mod.moduleId ?? mod.relativeModuleId ?? \"\";\n const sourcePath = moduleId.startsWith(\"/\")\n ? moduleId\n : `${projectRoot}/${moduleId}`;\n\n for (const test of collection.allTests()) {\n const meta = test.meta();\n const story = meta?.[\"story\"] as StoryMeta | undefined;\n\n if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n const result = test.result();\n const state = result?.state;\n const errors = state === \"failed\" && result ? result.errors : undefined;\n\n testCases.push({\n externalId: test.name,\n title: story.scenario,\n titlePath: story.suitePath\n ? [...story.suitePath, story.scenario]\n : [story.scenario],\n story,\n sourceFile: sourcePath,\n sourceLine: undefined, // Vitest doesn't provide line numbers easily\n status: mapVitestStatus(state),\n durationMs: result?.duration,\n error: errors?.length\n ? {\n message: formatVitestError(errors[0]),\n stack: errors[0].stack,\n }\n : undefined,\n stepEvents: undefined, // Vitest doesn't provide step-level results\n attachments: undefined, // Vitest doesn't capture attachments\n meta: { vitestState: state },\n retry: 0,\n retries: 0,\n projectName: undefined,\n });\n }\n }\n\n return {\n testCases,\n startedAtMs: options.startedAtMs,\n finishedAtMs: Date.now(),\n projectRoot,\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Format Vitest error message.\n */\nfunction formatVitestError(error: VitestSerializedError): string {\n const parts: string[] = [];\n\n if (error.message) {\n parts.push(error.message);\n }\n\n if (error.diff) {\n parts.push(\"\", error.diff);\n }\n\n return parts.join(\"\\n\") || \"Unknown error\";\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n","/**\n * Playwright Adapter - Layer 1.\n *\n * Transforms Playwright test results into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus, RawAttachment } from \"../../types/raw\";\n\n/** Playwright test status */\nexport type PlaywrightStatus =\n | \"passed\"\n | \"failed\"\n | \"skipped\"\n | \"timedOut\"\n | \"interrupted\";\n\n/** Playwright test error */\nexport interface PlaywrightError {\n message?: string;\n stack?: string;\n}\n\n/** Playwright attachment */\nexport interface PlaywrightAttachment {\n name: string;\n contentType: string;\n path?: string;\n body?: Buffer;\n}\n\n/** Playwright test result */\nexport interface PlaywrightTestResult {\n status: PlaywrightStatus;\n duration: number;\n errors: PlaywrightError[];\n attachments: PlaywrightAttachment[];\n retry: number;\n /** Optional step events if caller captures Playwright step timing. */\n stepEvents?: Array<{\n index?: number;\n stepId?: string;\n title?: string;\n status?: RawStatus;\n durationMs?: number;\n errorMessage?: string;\n }>;\n}\n\n/** Playwright test case annotation */\nexport interface PlaywrightAnnotation {\n type: string;\n description?: string;\n}\n\n/** Playwright test location */\nexport interface PlaywrightLocation {\n file: string;\n line: number;\n column: number;\n}\n\n/** Playwright test case shape (minimal) */\nexport interface PlaywrightTestCase {\n title: string;\n titlePath: () => string[];\n annotations: PlaywrightAnnotation[];\n location: PlaywrightLocation;\n retries: number;\n}\n\n/** Options for Playwright adapter */\nexport interface PlaywrightAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n /** Start time (epoch ms) */\n startedAtMs?: number;\n /** Playwright project name */\n projectName?: string;\n}\n\n/**\n * Map Playwright status to RawStatus.\n */\nfunction mapPlaywrightStatus(status: PlaywrightStatus): RawStatus {\n switch (status) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"skipped\":\n return \"skip\";\n case \"timedOut\":\n return \"timeout\";\n case \"interrupted\":\n return \"interrupted\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Playwright test results to RawRun.\n *\n * @param testResults - Array of [testCase, result] tuples\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptPlaywrightRun(\n testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>,\n options: PlaywrightAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n const projectRoot = options.projectRoot ?? process.cwd();\n\n for (const [test, result] of testResults) {\n // Find story-meta annotation\n const storyAnnotation = test.annotations.find((a) => a.type === \"story-meta\");\n if (!storyAnnotation?.description) continue;\n\n let story: StoryMeta;\n try {\n story = JSON.parse(storyAnnotation.description);\n } catch {\n continue; // Skip if annotation is not valid JSON\n }\n\n if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n // Convert attachments\n const attachments = convertAttachments(result.attachments);\n\n // Get error info\n const error = result.errors?.length\n ? {\n message: result.errors[0].message,\n stack: result.errors[0].stack,\n }\n : undefined;\n\n const stepEvents =\n result.stepEvents?.length\n ? result.stepEvents\n : story.steps\n .map((step, index) =>\n step.durationMs !== undefined\n ? {\n index,\n stepId: step.id,\n title: step.text,\n durationMs: step.durationMs,\n }\n : undefined,\n )\n .filter((e): e is NonNullable<typeof e> => e !== undefined);\n\n testCases.push({\n externalId: test.titlePath().join(\" > \"),\n title: story.scenario,\n titlePath: test.titlePath(),\n story,\n sourceFile: test.location.file,\n sourceLine: test.location.line,\n status: mapPlaywrightStatus(result.status),\n durationMs: result.duration,\n error,\n stepEvents: stepEvents.length > 0 ? stepEvents : undefined,\n attachments,\n meta: {\n playwrightStatus: result.status,\n column: test.location.column,\n },\n retry: result.retry,\n retries: test.retries,\n projectName: options.projectName,\n });\n }\n\n return {\n testCases,\n startedAtMs: options.startedAtMs,\n finishedAtMs: Date.now(),\n projectRoot,\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Convert Playwright attachments to raw attachments.\n */\nfunction convertAttachments(\n attachments: PlaywrightAttachment[]\n): RawAttachment[] {\n return attachments.map((att) => ({\n name: att.name,\n mediaType: att.contentType,\n path: att.path,\n body: att.body ? att.body.toString(\"base64\") : undefined,\n encoding: att.body ? \"BASE64\" as const : undefined,\n byteLength: att.body?.length,\n }));\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACgDA,SAAS,cAAc,QAA6C;AAClE,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAUO,SAAS,aACd,aACA,cACA,UAA8B,CAAC,GACvB;AACR,QAAM,YAA2B,CAAC;AAGlC,QAAM,iBAAiB,oBAAI,IAA4B;AACvD,aAAW,cAAc,YAAY,aAAa;AAChD,mBAAe,IAAI,WAAW,cAAc,UAAU;AAAA,EACxD;AAGA,aAAW,UAAU,cAAc;AACjC,UAAM,aAAa,eAAe,IAAI,OAAO,YAAY;AAEzD,eAAW,QAAQ,OAAO,WAAW;AACnC,UAAI,CAAC,MAAM,SAAU;AAGrB,YAAM,eAAe,qBAAqB,YAAY,IAAI;AAE1D,gBAAU,KAAK;AAAA,QACb,YAAY,cAAc;AAAA,QAC1B,OAAO,KAAK;AAAA,QACZ,WAAW,KAAK,YACZ,CAAC,GAAG,KAAK,WAAW,KAAK,QAAQ,IACjC,CAAC,KAAK,QAAQ;AAAA,QAClB,OAAO;AAAA,QACP,YAAY,OAAO;AAAA,QACnB,YAAY;AAAA;AAAA,Q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IAAI;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,QAAQ,IAAI,IAAI;AAClB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,KAAK;AAAA,MACL,aAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":["detectCI","detectCI"]} |
@@ -1,1 +0,1 @@ | ||
| export { J as JestAdapterOptions, j as JestAggregatedResult, k as JestFileResult, l as JestTestResult, P as PlaywrightAdapterOptions, n as PlaywrightAnnotation, o as PlaywrightAttachment, p as PlaywrightError, q as PlaywrightLocation, r as PlaywrightStatus, s as PlaywrightTestCase, t as PlaywrightTestResult, z as StoryFileReport, V as VitestAdapterOptions, A as VitestSerializedError, B as VitestState, E as VitestTestCase, F as VitestTestModule, G as VitestTestResult, f as adaptJestRun, g as adaptPlaywrightRun, h as adaptVitestRun } from './index-C0OOaaiK.cjs'; | ||
| export { J as JestAdapterOptions, j as JestAggregatedResult, k as JestFileResult, l as JestTestResult, P as PlaywrightAdapterOptions, n as PlaywrightAnnotation, o as PlaywrightAttachment, p as PlaywrightError, q as PlaywrightLocation, r as PlaywrightStatus, s as PlaywrightTestCase, t as PlaywrightTestResult, z as StoryFileReport, V as VitestAdapterOptions, A as VitestSerializedError, B as VitestState, E as VitestTestCase, F as VitestTestModule, G as VitestTestResult, f as adaptJestRun, g as adaptPlaywrightRun, h as adaptVitestRun } from './index-fqrm5-Xr.cjs'; |
@@ -1,1 +0,1 @@ | ||
| export { J as JestAdapterOptions, j as JestAggregatedResult, k as JestFileResult, l as JestTestResult, P as PlaywrightAdapterOptions, n as PlaywrightAnnotation, o as PlaywrightAttachment, p as PlaywrightError, q as PlaywrightLocation, r as PlaywrightStatus, s as PlaywrightTestCase, t as PlaywrightTestResult, z as StoryFileReport, V as VitestAdapterOptions, A as VitestSerializedError, B as VitestState, E as VitestTestCase, F as VitestTestModule, G as VitestTestResult, f as adaptJestRun, g as adaptPlaywrightRun, h as adaptVitestRun } from './index-C0OOaaiK.js'; | ||
| export { J as JestAdapterOptions, j as JestAggregatedResult, k as JestFileResult, l as JestTestResult, P as PlaywrightAdapterOptions, n as PlaywrightAnnotation, o as PlaywrightAttachment, p as PlaywrightError, q as PlaywrightLocation, r as PlaywrightStatus, s as PlaywrightTestCase, t as PlaywrightTestResult, z as StoryFileReport, V as VitestAdapterOptions, A as VitestSerializedError, B as VitestState, E as VitestTestCase, F as VitestTestModule, G as VitestTestResult, f as adaptJestRun, g as adaptPlaywrightRun, h as adaptVitestRun } from './index-fqrm5-Xr.js'; |
+9
-2
@@ -224,2 +224,10 @@ // src/converters/adapters/jest.ts | ||
| } : void 0; | ||
| const stepEvents = result.stepEvents?.length ? result.stepEvents : story.steps.map( | ||
| (step, index) => step.durationMs !== void 0 ? { | ||
| index, | ||
| stepId: step.id, | ||
| title: step.text, | ||
| durationMs: step.durationMs | ||
| } : void 0 | ||
| ).filter((e) => e !== void 0); | ||
| testCases.push({ | ||
@@ -235,4 +243,3 @@ externalId: test.titlePath().join(" > "), | ||
| error, | ||
| stepEvents: void 0, | ||
| // Playwright could provide step info, but we don't capture it yet | ||
| stepEvents: stepEvents.length > 0 ? stepEvents : void 0, | ||
| attachments, | ||
@@ -239,0 +246,0 @@ meta: { |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"sources":["../src/converters/adapters/jest.ts","../src/converters/adapters/vitest.ts","../src/converters/adapters/playwright.ts"],"sourcesContent":["/**\n * Jest Adapter - Layer 1.\n *\n * Transforms Jest test results and story reports into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"../../types/raw\";\n\n/** Jest test result shape (subset of what Jest provides) */\nexport interface JestTestResult {\n fullName: string;\n status: \"passed\" | \"failed\" | \"pending\" | \"todo\";\n duration?: number;\n failureMessages?: string[];\n}\n\n/** Jest file result shape */\nexport interface JestFileResult {\n testFilePath: string;\n testResults: JestTestResult[];\n}\n\n/** Jest aggregated result shape */\nexport interface JestAggregatedResult {\n testResults: JestFileResult[];\n startTime?: number;\n}\n\n/** Story file report written by story.init() */\nexport interface StoryFileReport {\n testFilePath: string;\n scenarios: StoryMeta[];\n}\n\n/** Options for Jest adapter */\nexport interface JestAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n}\n\n/**\n * Map Jest status to RawStatus.\n */\nfunction mapJestStatus(status: JestTestResult[\"status\"]): RawStatus {\n switch (status) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"pending\":\n return \"pending\";\n case \"todo\":\n return \"todo\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Jest results and story reports to RawRun.\n *\n * @param jestResults - Jest aggregated results\n * @param storyReports - Story reports from story.init()\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptJestRun(\n jestResults: JestAggregatedResult,\n storyReports: StoryFileReport[],\n options: JestAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n\n // Build map of Jest results by file for lookup\n const fileResultsMap = new Map<string, JestFileResult>();\n for (const fileResult of jestResults.testResults) {\n fileResultsMap.set(fileResult.testFilePath, fileResult);\n }\n\n // Process each story report\n for (const report of storyReports) {\n const fileResult = fileResultsMap.get(report.testFilePath);\n\n for (const meta of report.scenarios) {\n if (!meta?.scenario) continue;\n\n // Find matching Jest test result\n const matchingTest = findMatchingJestTest(fileResult, meta);\n\n testCases.push({\n externalId: matchingTest?.fullName,\n title: meta.scenario,\n titlePath: meta.suitePath\n ? [...meta.suitePath, meta.scenario]\n : [meta.scenario],\n story: meta,\n sourceFile: report.testFilePath,\n sourceLine: undefined, // Jest doesn't provide line numbers\n status: matchingTest ? mapJestStatus(matchingTest.status) : \"unknown\",\n durationMs: matchingTest?.duration,\n error: matchingTest?.failureMessages?.length\n ? { message: matchingTest.failureMessages.join(\"\\n\") }\n : undefined,\n stepEvents: undefined, // Jest doesn't provide step-level results\n attachments: undefined, // Jest doesn't capture attachments\n meta: { jestStatus: matchingTest?.status },\n retry: 0,\n retries: 0,\n projectName: undefined,\n });\n }\n }\n\n return {\n testCases,\n startedAtMs: jestResults.startTime,\n finishedAtMs: Date.now(),\n projectRoot: options.projectRoot ?? process.cwd(),\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Find matching Jest test result for a story.\n *\n * Matches by constructing fullName from suitePath and scenario.\n */\nfunction findMatchingJestTest(\n fileResult: JestFileResult | undefined,\n meta: StoryMeta\n): JestTestResult | undefined {\n if (!fileResult) return undefined;\n\n // Construct expected fullName\n const expectedFullName = meta.suitePath\n ? [...meta.suitePath, meta.scenario].join(\" > \")\n : meta.scenario;\n\n return fileResult.testResults.find((test) => test.fullName === expectedFullName);\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n","/**\n * Vitest Adapter - Layer 1.\n *\n * Transforms Vitest test results into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"../../types/raw\";\n\n/** Vitest test state */\nexport type VitestState = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\n/** Vitest serialized error */\nexport interface VitestSerializedError {\n message?: string;\n stack?: string;\n diff?: string;\n}\n\n/** Vitest test result shape */\nexport interface VitestTestResult {\n state?: VitestState;\n duration?: number;\n errors?: VitestSerializedError[];\n}\n\n/** Vitest test case shape (minimal) */\nexport interface VitestTestCase {\n name: string;\n meta: () => Record<string, unknown>;\n result: () => VitestTestResult | undefined;\n}\n\n/** Vitest test module shape (minimal) */\nexport interface VitestTestModule {\n moduleId?: string;\n relativeModuleId?: string;\n children?: {\n allTests: () => Iterable<VitestTestCase>;\n };\n}\n\n/** Options for Vitest adapter */\nexport interface VitestAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n /** Start time (epoch ms) */\n startedAtMs?: number;\n}\n\n/**\n * Map Vitest state to RawStatus.\n */\nfunction mapVitestStatus(state?: VitestState): RawStatus {\n switch (state) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"skipped\":\n return \"skip\";\n case \"pending\":\n return \"pending\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Vitest test modules to RawRun.\n *\n * @param testModules - Vitest test modules\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptVitestRun(\n testModules: ReadonlyArray<VitestTestModule>,\n options: VitestAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n const projectRoot = options.projectRoot ?? process.cwd();\n\n for (const mod of testModules) {\n const collection = mod.children;\n if (!collection) continue;\n\n // Get module path\n const moduleId = mod.moduleId ?? mod.relativeModuleId ?? \"\";\n const sourcePath = moduleId.startsWith(\"/\")\n ? moduleId\n : `${projectRoot}/${moduleId}`;\n\n for (const test of collection.allTests()) {\n const meta = test.meta();\n const story = meta?.[\"story\"] as StoryMeta | undefined;\n\n if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n const result = test.result();\n const state = result?.state;\n const errors = state === \"failed\" && result ? result.errors : undefined;\n\n testCases.push({\n externalId: test.name,\n title: story.scenario,\n titlePath: story.suitePath\n ? [...story.suitePath, story.scenario]\n : [story.scenario],\n story,\n sourceFile: sourcePath,\n sourceLine: undefined, // Vitest doesn't provide line numbers easily\n status: mapVitestStatus(state),\n durationMs: result?.duration,\n error: errors?.length\n ? {\n message: formatVitestError(errors[0]),\n stack: errors[0].stack,\n }\n : undefined,\n stepEvents: undefined, // Vitest doesn't provide step-level results\n attachments: undefined, // Vitest doesn't capture attachments\n meta: { vitestState: state },\n retry: 0,\n retries: 0,\n projectName: undefined,\n });\n }\n }\n\n return {\n testCases,\n startedAtMs: options.startedAtMs,\n finishedAtMs: Date.now(),\n projectRoot,\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Format Vitest error message.\n */\nfunction formatVitestError(error: VitestSerializedError): string {\n const parts: string[] = [];\n\n if (error.message) {\n parts.push(error.message);\n }\n\n if (error.diff) {\n parts.push(\"\", error.diff);\n }\n\n return parts.join(\"\\n\") || \"Unknown error\";\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n","/**\n * Playwright Adapter - Layer 1.\n *\n * Transforms Playwright test results into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus, RawAttachment } from \"../../types/raw\";\n\n/** Playwright test status */\nexport type PlaywrightStatus =\n | \"passed\"\n | \"failed\"\n | \"skipped\"\n | \"timedOut\"\n | \"interrupted\";\n\n/** Playwright test error */\nexport interface PlaywrightError {\n message?: string;\n stack?: string;\n}\n\n/** Playwright attachment */\nexport interface PlaywrightAttachment {\n name: string;\n contentType: string;\n path?: string;\n body?: Buffer;\n}\n\n/** Playwright test result */\nexport interface PlaywrightTestResult {\n status: PlaywrightStatus;\n duration: number;\n errors: PlaywrightError[];\n attachments: PlaywrightAttachment[];\n retry: number;\n}\n\n/** Playwright test case annotation */\nexport interface PlaywrightAnnotation {\n type: string;\n description?: string;\n}\n\n/** Playwright test location */\nexport interface PlaywrightLocation {\n file: string;\n line: number;\n column: number;\n}\n\n/** Playwright test case shape (minimal) */\nexport interface PlaywrightTestCase {\n title: string;\n titlePath: () => string[];\n annotations: PlaywrightAnnotation[];\n location: PlaywrightLocation;\n retries: number;\n}\n\n/** Options for Playwright adapter */\nexport interface PlaywrightAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n /** Start time (epoch ms) */\n startedAtMs?: number;\n /** Playwright project name */\n projectName?: string;\n}\n\n/**\n * Map Playwright status to RawStatus.\n */\nfunction mapPlaywrightStatus(status: PlaywrightStatus): RawStatus {\n switch (status) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"skipped\":\n return \"skip\";\n case \"timedOut\":\n return \"timeout\";\n case \"interrupted\":\n return \"interrupted\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Playwright test results to RawRun.\n *\n * @param testResults - Array of [testCase, result] tuples\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptPlaywrightRun(\n testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>,\n options: PlaywrightAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n const projectRoot = options.projectRoot ?? process.cwd();\n\n for (const [test, result] of testResults) {\n // Find story-meta annotation\n const storyAnnotation = test.annotations.find((a) => a.type === \"story-meta\");\n if (!storyAnnotation?.description) continue;\n\n let story: StoryMeta;\n try {\n story = JSON.parse(storyAnnotation.description);\n } catch {\n continue; // Skip if annotation is not valid JSON\n }\n\n if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n // Convert attachments\n const attachments = convertAttachments(result.attachments);\n\n // Get error info\n const error = result.errors?.length\n ? {\n message: result.errors[0].message,\n stack: result.errors[0].stack,\n }\n : undefined;\n\n testCases.push({\n externalId: test.titlePath().join(\" > \"),\n title: story.scenario,\n titlePath: test.titlePath(),\n story,\n sourceFile: test.location.file,\n sourceLine: test.location.line,\n status: mapPlaywrightStatus(result.status),\n durationMs: result.duration,\n error,\n stepEvents: undefined, // Playwright could provide step info, but we don't capture it yet\n attachments,\n meta: {\n playwrightStatus: result.status,\n column: test.location.column,\n },\n retry: result.retry,\n retries: test.retries,\n projectName: options.projectName,\n });\n }\n\n return {\n testCases,\n startedAtMs: options.startedAtMs,\n finishedAtMs: Date.now(),\n projectRoot,\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Convert Playwright attachments to raw attachments.\n */\nfunction convertAttachments(\n attachments: PlaywrightAttachment[]\n): RawAttachment[] {\n return attachments.map((att) => ({\n name: att.name,\n mediaType: att.contentType,\n path: att.path,\n body: att.body ? att.body.toString(\"base64\") : undefined,\n encoding: att.body ? \"BASE64\" as const : undefined,\n byteLength: att.body?.length,\n }));\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.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W,IAAI;AAAA,IACf,MAAM,IAAI;AAAA,IACV,MAAM,IAAI,OAAO,IAAI,KAAK,SAAS,QAAQ,IAAI;AAAA,IAC/C,UAAU,IAAI,OAAO,WAAoB;AAAA,IACzC,YAAY,IAAI,MAAM;AAAA,EACxB,EAAE;AACJ;AAKA,SAASA,YAAW;AAClB,MAAI,QAAQ,IAAI,mBAAmB,QAAQ;AACzC,WAAO;AAAA,MACL,MAAM;AAAA,MACN,KAAK,QAAQ,IAAI,qBAAqB,QAAQ,IAAI,oBAC9C,GAAG,QAAQ,IAAI,iBAAiB,IAAI,QAAQ,IAAI,iBAAiB,iBAAiB,QAAQ,IAAI,aAAa,KAC3G;AAAA,MACJ,aAAa,QAAQ,IAAI;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,QAAQ,IAAI,aAAa;AAC3B,WAAO;AAAA,MACL,MAAM;AAAA,MACN,KAAK,QAAQ,IAAI;AAAA,MACjB,aAAa,QAAQ,IAAI;AAAA,IAC3B;AAAA,EACF;AAEA,MAAI,QAAQ,IAAI,IAAI;AAClB,WAAO;AAAA,MACL,MAAM;AAAA,MACN,KAAK;AAAA,MACL,aAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":["detectCI","detectCI"]} | ||
| {"version":3,"sources":["../src/converters/adapters/jest.ts","../src/converters/adapters/vitest.ts","../src/converters/adapters/playwright.ts"],"sourcesContent":["/**\n * Jest Adapter - Layer 1.\n *\n * Transforms Jest test results and story reports into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"../../types/raw\";\n\n/** Jest test result shape (subset of what Jest provides) */\nexport interface JestTestResult {\n fullName: string;\n status: \"passed\" | \"failed\" | \"pending\" | \"todo\";\n duration?: number;\n failureMessages?: string[];\n}\n\n/** Jest file result shape */\nexport interface JestFileResult {\n testFilePath: string;\n testResults: JestTestResult[];\n}\n\n/** Jest aggregated result shape */\nexport interface JestAggregatedResult {\n testResults: JestFileResult[];\n startTime?: number;\n}\n\n/** Story file report written by story.init() */\nexport interface StoryFileReport {\n testFilePath: string;\n scenarios: StoryMeta[];\n}\n\n/** Options for Jest adapter */\nexport interface JestAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n}\n\n/**\n * Map Jest status to RawStatus.\n */\nfunction mapJestStatus(status: JestTestResult[\"status\"]): RawStatus {\n switch (status) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"pending\":\n return \"pending\";\n case \"todo\":\n return \"todo\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Jest results and story reports to RawRun.\n *\n * @param jestResults - Jest aggregated results\n * @param storyReports - Story reports from story.init()\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptJestRun(\n jestResults: JestAggregatedResult,\n storyReports: StoryFileReport[],\n options: JestAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n\n // Build map of Jest results by file for lookup\n const fileResultsMap = new Map<string, JestFileResult>();\n for (const fileResult of jestResults.testResults) {\n fileResultsMap.set(fileResult.testFilePath, fileResult);\n }\n\n // Process each story report\n for (const report of storyReports) {\n const fileResult = fileResultsMap.get(report.testFilePath);\n\n for (const meta of report.scenarios) {\n if (!meta?.scenario) continue;\n\n // Find matching Jest test result\n const matchingTest = findMatchingJestTest(fileResult, meta);\n\n testCases.push({\n externalId: matchingTest?.fullName,\n title: meta.scenario,\n titlePath: meta.suitePath\n ? [...meta.suitePath, meta.scenario]\n : [meta.scenario],\n story: meta,\n sourceFile: report.testFilePath,\n sourceLine: undefined, // Jest doesn't provide line numbers\n status: matchingTest ? mapJestStatus(matchingTest.status) : \"unknown\",\n durationMs: matchingTest?.duration,\n error: matchingTest?.failureMessages?.length\n ? { message: matchingTest.failureMessages.join(\"\\n\") }\n : undefined,\n stepEvents: undefined, // Jest doesn't provide step-level results\n attachments: undefined, // Jest doesn't capture attachments\n meta: { jestStatus: matchingTest?.status },\n retry: 0,\n retries: 0,\n projectName: undefined,\n });\n }\n }\n\n return {\n testCases,\n startedAtMs: jestResults.startTime,\n finishedAtMs: Date.now(),\n projectRoot: options.projectRoot ?? process.cwd(),\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Find matching Jest test result for a story.\n *\n * Matches by constructing fullName from suitePath and scenario.\n */\nfunction findMatchingJestTest(\n fileResult: JestFileResult | undefined,\n meta: StoryMeta\n): JestTestResult | undefined {\n if (!fileResult) return undefined;\n\n // Construct expected fullName\n const expectedFullName = meta.suitePath\n ? [...meta.suitePath, meta.scenario].join(\" > \")\n : meta.scenario;\n\n return fileResult.testResults.find((test) => test.fullName === expectedFullName);\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n","/**\n * Vitest Adapter - Layer 1.\n *\n * Transforms Vitest test results into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus } from \"../../types/raw\";\n\n/** Vitest test state */\nexport type VitestState = \"passed\" | \"failed\" | \"skipped\" | \"pending\";\n\n/** Vitest serialized error */\nexport interface VitestSerializedError {\n message?: string;\n stack?: string;\n diff?: string;\n}\n\n/** Vitest test result shape */\nexport interface VitestTestResult {\n state?: VitestState;\n duration?: number;\n errors?: VitestSerializedError[];\n}\n\n/** Vitest test case shape (minimal) */\nexport interface VitestTestCase {\n name: string;\n meta: () => Record<string, unknown>;\n result: () => VitestTestResult | undefined;\n}\n\n/** Vitest test module shape (minimal) */\nexport interface VitestTestModule {\n moduleId?: string;\n relativeModuleId?: string;\n children?: {\n allTests: () => Iterable<VitestTestCase>;\n };\n}\n\n/** Options for Vitest adapter */\nexport interface VitestAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n /** Start time (epoch ms) */\n startedAtMs?: number;\n}\n\n/**\n * Map Vitest state to RawStatus.\n */\nfunction mapVitestStatus(state?: VitestState): RawStatus {\n switch (state) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"skipped\":\n return \"skip\";\n case \"pending\":\n return \"pending\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Vitest test modules to RawRun.\n *\n * @param testModules - Vitest test modules\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptVitestRun(\n testModules: ReadonlyArray<VitestTestModule>,\n options: VitestAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n const projectRoot = options.projectRoot ?? process.cwd();\n\n for (const mod of testModules) {\n const collection = mod.children;\n if (!collection) continue;\n\n // Get module path\n const moduleId = mod.moduleId ?? mod.relativeModuleId ?? \"\";\n const sourcePath = moduleId.startsWith(\"/\")\n ? moduleId\n : `${projectRoot}/${moduleId}`;\n\n for (const test of collection.allTests()) {\n const meta = test.meta();\n const story = meta?.[\"story\"] as StoryMeta | undefined;\n\n if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n const result = test.result();\n const state = result?.state;\n const errors = state === \"failed\" && result ? result.errors : undefined;\n\n testCases.push({\n externalId: test.name,\n title: story.scenario,\n titlePath: story.suitePath\n ? [...story.suitePath, story.scenario]\n : [story.scenario],\n story,\n sourceFile: sourcePath,\n sourceLine: undefined, // Vitest doesn't provide line numbers easily\n status: mapVitestStatus(state),\n durationMs: result?.duration,\n error: errors?.length\n ? {\n message: formatVitestError(errors[0]),\n stack: errors[0].stack,\n }\n : undefined,\n stepEvents: undefined, // Vitest doesn't provide step-level results\n attachments: undefined, // Vitest doesn't capture attachments\n meta: { vitestState: state },\n retry: 0,\n retries: 0,\n projectName: undefined,\n });\n }\n }\n\n return {\n testCases,\n startedAtMs: options.startedAtMs,\n finishedAtMs: Date.now(),\n projectRoot,\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Format Vitest error message.\n */\nfunction formatVitestError(error: VitestSerializedError): string {\n const parts: string[] = [];\n\n if (error.message) {\n parts.push(error.message);\n }\n\n if (error.diff) {\n parts.push(\"\", error.diff);\n }\n\n return parts.join(\"\\n\") || \"Unknown error\";\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n","/**\n * Playwright Adapter - Layer 1.\n *\n * Transforms Playwright test results into RawRun.\n */\n\nimport type { StoryMeta } from \"../../types/story\";\nimport type { RawRun, RawTestCase, RawStatus, RawAttachment } from \"../../types/raw\";\n\n/** Playwright test status */\nexport type PlaywrightStatus =\n | \"passed\"\n | \"failed\"\n | \"skipped\"\n | \"timedOut\"\n | \"interrupted\";\n\n/** Playwright test error */\nexport interface PlaywrightError {\n message?: string;\n stack?: string;\n}\n\n/** Playwright attachment */\nexport interface PlaywrightAttachment {\n name: string;\n contentType: string;\n path?: string;\n body?: Buffer;\n}\n\n/** Playwright test result */\nexport interface PlaywrightTestResult {\n status: PlaywrightStatus;\n duration: number;\n errors: PlaywrightError[];\n attachments: PlaywrightAttachment[];\n retry: number;\n /** Optional step events if caller captures Playwright step timing. */\n stepEvents?: Array<{\n index?: number;\n stepId?: string;\n title?: string;\n status?: RawStatus;\n durationMs?: number;\n errorMessage?: string;\n }>;\n}\n\n/** Playwright test case annotation */\nexport interface PlaywrightAnnotation {\n type: string;\n description?: string;\n}\n\n/** Playwright test location */\nexport interface PlaywrightLocation {\n file: string;\n line: number;\n column: number;\n}\n\n/** Playwright test case shape (minimal) */\nexport interface PlaywrightTestCase {\n title: string;\n titlePath: () => string[];\n annotations: PlaywrightAnnotation[];\n location: PlaywrightLocation;\n retries: number;\n}\n\n/** Options for Playwright adapter */\nexport interface PlaywrightAdapterOptions {\n /** Project root directory */\n projectRoot?: string;\n /** Package version */\n packageVersion?: string;\n /** Git SHA */\n gitSha?: string;\n /** Start time (epoch ms) */\n startedAtMs?: number;\n /** Playwright project name */\n projectName?: string;\n}\n\n/**\n * Map Playwright status to RawStatus.\n */\nfunction mapPlaywrightStatus(status: PlaywrightStatus): RawStatus {\n switch (status) {\n case \"passed\":\n return \"pass\";\n case \"failed\":\n return \"fail\";\n case \"skipped\":\n return \"skip\";\n case \"timedOut\":\n return \"timeout\";\n case \"interrupted\":\n return \"interrupted\";\n default:\n return \"unknown\";\n }\n}\n\n/**\n * Adapt Playwright test results to RawRun.\n *\n * @param testResults - Array of [testCase, result] tuples\n * @param options - Adapter options\n * @returns RawRun for ACL processing\n */\nexport function adaptPlaywrightRun(\n testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>,\n options: PlaywrightAdapterOptions = {}\n): RawRun {\n const testCases: RawTestCase[] = [];\n const projectRoot = options.projectRoot ?? process.cwd();\n\n for (const [test, result] of testResults) {\n // Find story-meta annotation\n const storyAnnotation = test.annotations.find((a) => a.type === \"story-meta\");\n if (!storyAnnotation?.description) continue;\n\n let story: StoryMeta;\n try {\n story = JSON.parse(storyAnnotation.description);\n } catch {\n continue; // Skip if annotation is not valid JSON\n }\n\n if (!story?.scenario || !Array.isArray(story.steps)) continue;\n\n // Convert attachments\n const attachments = convertAttachments(result.attachments);\n\n // Get error info\n const error = result.errors?.length\n ? {\n message: result.errors[0].message,\n stack: result.errors[0].stack,\n }\n : undefined;\n\n const stepEvents =\n result.stepEvents?.length\n ? result.stepEvents\n : story.steps\n .map((step, index) =>\n step.durationMs !== undefined\n ? {\n index,\n stepId: step.id,\n title: step.text,\n durationMs: step.durationMs,\n }\n : undefined,\n )\n .filter((e): e is NonNullable<typeof e> => e !== undefined);\n\n testCases.push({\n externalId: test.titlePath().join(\" > \"),\n title: story.scenario,\n titlePath: test.titlePath(),\n story,\n sourceFile: test.location.file,\n sourceLine: test.location.line,\n status: mapPlaywrightStatus(result.status),\n durationMs: result.duration,\n error,\n stepEvents: stepEvents.length > 0 ? stepEvents : undefined,\n attachments,\n meta: {\n playwrightStatus: result.status,\n column: test.location.column,\n },\n retry: result.retry,\n retries: test.retries,\n projectName: options.projectName,\n });\n }\n\n return {\n testCases,\n startedAtMs: options.startedAtMs,\n finishedAtMs: Date.now(),\n projectRoot,\n packageVersion: options.packageVersion,\n gitSha: options.gitSha,\n ci: detectCI(),\n };\n}\n\n/**\n * Convert Playwright attachments to raw attachments.\n */\nfunction convertAttachments(\n attachments: PlaywrightAttachment[]\n): RawAttachment[] {\n return attachments.map((att) => ({\n name: att.name,\n mediaType: att.contentType,\n path: att.path,\n body: att.body ? att.body.toString(\"base64\") : undefined,\n encoding: att.body ? \"BASE64\" as const : undefined,\n byteLength: att.body?.length,\n }));\n}\n\n/**\n * Detect CI environment.\n */\nfunction detectCI() {\n if (process.env.GITHUB_ACTIONS === \"true\") {\n return {\n name: \"GitHub Actions\",\n url: process.env.GITHUB_SERVER_URL && process.env.GITHUB_REPOSITORY\n ? `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}`\n : undefined,\n buildNumber: process.env.GITHUB_RUN_NUMBER,\n };\n }\n\n if (process.env.JENKINS_URL) {\n return {\n name: \"Jenkins\",\n url: process.env.BUILD_URL,\n buildNumber: process.env.BUILD_NUMBER,\n };\n }\n\n if (process.env.CI) {\n return {\n name: \"CI\",\n url: undefined,\n buildNumber: undefined,\n };\n }\n\n return undefined;\n}\n"],"mappings":";AAgDA,SAAS,cAAc,QAA6C;AAClE,UAAQ,QAAQ;AAAA,IACd,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAUO,SAAS,aACd,aACA,cACA,UAA8B,CAAC,GACvB;AACR,QAAM,YAA2B,CAAC;AAGlC,QAAM,iBAAiB,oBAAI,IAA4B;AACvD,aAAW,cAAc,YAAY,aAAa;AAChD,mBAAe,IAAI,WAAW,cAAc,UAAU;AAAA,EACxD;AAGA,aAAW,UAAU,cAAc;AACjC,UAAM,aAAa,eAAe,IAAI,OAAO,YAAY;AAEzD,eAAW,QAAQ,OAAO,WAAW;AACnC,UAAI,CAAC,MAAM,SAAU;AAGrB,YAAM,eAAe,qBAAqB,YAAY,IAAI;AAE1D,gBAAU,KAAK;AAAA,QACb,YAAY,cAAc;AAAA,QAC1B,OAAO,KAAK;AAAA,QACZ,WAAW,KAAK,YACZ,CAAC,GAAG,KAAK,WAAW,KAAK,QAAQ,IACjC,CAAC,KAAK,QAAQ;AAAA,QAClB,OAAO;AAAA,QACP,YAAY,OAAO;AAAA,QACnB,YAAY;AAAA;AAAA,QACZ,QAAQ,eAAe,cAAc,aAAa,MAAM,IAAI;AAAA,QAC5D,YAAY,cAAc;AAA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O;AAAA,MACL,MAAM;AAAA,MACN,KAAK;AAAA,MACL,aAAa;AAAA,IACf;AAAA,EACF;AAEA,SAAO;AACT;","names":["detectCI","detectCI"]} |
+1
-1
| { | ||
| "name": "executable-stories-formatters", | ||
| "version": "0.7.12", | ||
| "version": "0.7.13", | ||
| "description": "Cucumber-compatible report formats (HTML, Markdown, JUnit XML, Cucumber JSON) for executable-stories test results.", | ||
@@ -5,0 +5,0 @@ "author": "Jag Reehal <jag@jagreehal.com>", |
| /** | ||
| * 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[]; | ||
| /** 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; | ||
| 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>; | ||
| /** 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; | ||
| } | ||
| /** | ||
| * 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 { | ||
| 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 | undefined; | ||
| /** Convert canonical CIInfo back to RawCIInfo (for serialization). */ | ||
| declare function toRawCIInfo(ci?: CIInfo): RawCIInfo | undefined; | ||
| /** | ||
| * 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; | ||
| } | ||
| /** 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 VitestSerializedError as A, type VitestState as B, type CIInfo as C, type DocEntry as D, type VitestTestCase as E, type VitestTestModule as F, type VitestTestResult as G, toCIInfo as H, toRawCIInfo as I, type JestAdapterOptions as J, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type RawStatus as R, type StoryMeta as S, type VitestAdapterOptions as V, type StoryStep as a, type CIProvider as b, type RawAttachment as c, type RawRun as d, type RawCIInfo as e, adaptJestRun as f, adaptPlaywrightRun as g, adaptVitestRun as h, type DocPhase as i, type JestAggregatedResult as j, type JestFileResult as k, type JestTestResult as l, type OtelAttributeValue as m, type PlaywrightAnnotation as n, type PlaywrightAttachment as o, type PlaywrightError as p, type PlaywrightLocation as q, type PlaywrightStatus as r, type PlaywrightTestCase as s, type PlaywrightTestResult as t, type RawStepEvent as u, type RawTestCase as v, STORY_META_KEY as w, type StepKeyword as x, type StepMode as y, type StoryFileReport as z }; |
| /** | ||
| * 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[]; | ||
| /** 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; | ||
| 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>; | ||
| /** 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; | ||
| } | ||
| /** | ||
| * 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 { | ||
| 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 | undefined; | ||
| /** Convert canonical CIInfo back to RawCIInfo (for serialization). */ | ||
| declare function toRawCIInfo(ci?: CIInfo): RawCIInfo | undefined; | ||
| /** | ||
| * 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; | ||
| } | ||
| /** 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 VitestSerializedError as A, type VitestState as B, type CIInfo as C, type DocEntry as D, type VitestTestCase as E, type VitestTestModule as F, type VitestTestResult as G, toCIInfo as H, toRawCIInfo as I, type JestAdapterOptions as J, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type RawStatus as R, type StoryMeta as S, type VitestAdapterOptions as V, type StoryStep as a, type CIProvider as b, type RawAttachment as c, type RawRun as d, type RawCIInfo as e, adaptJestRun as f, adaptPlaywrightRun as g, adaptVitestRun as h, type DocPhase as i, type JestAggregatedResult as j, type JestFileResult as k, type JestTestResult as l, type OtelAttributeValue as m, type PlaywrightAnnotation as n, type PlaywrightAttachment as o, type PlaywrightError as p, type PlaywrightLocation as q, type PlaywrightStatus as r, type PlaywrightTestCase as s, type PlaywrightTestResult as t, type RawStepEvent as u, type RawTestCase as v, STORY_META_KEY as w, type StepKeyword as x, type StepMode as y, type StoryFileReport 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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
4919579
0.88%59884
0.64%