executable-stories-formatters 1.11.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { TestRunResult, TestCaseResult, TestStatus, Attachment } from 'executable-stories-core/types/test-result';
2
- export { Attachment, CIInfo, CoverageSummary, StepResult, TestCaseAttempt, TestCaseEvidence, TestCaseResult, TestRunResult, TestStatus } from 'executable-stories-core/types/test-result';
2
+ export { Attachment, CIInfo, CoverageSummary, FeatureDeclaration, GlossaryTerm, StepResult, TestCaseAttempt, TestCaseEvidence, TestCaseResult, TestRunResult, TestStatus } from 'executable-stories-core/types/test-result';
3
3
  import { StoryStep, DocEntry, NormalizedTicket, StepKeyword } from 'executable-stories-core/types/story';
4
4
  export { DocEntry, DocPhase, NormalizedTicket, STORY_META_KEY, StepKeyword, StepMode, StoryMeta, StoryStep } from 'executable-stories-core/types/story';
5
5
  import { CIInfo, CIProvider } from 'executable-stories-core/types/ci';
@@ -8,11 +8,15 @@ import { adaptJestRun, adaptPlaywrightRun, adaptVitestRun } from './adapters.cjs
8
8
  export { JestAdapterOptions, JestAggregatedResult, JestFileResult, JestTestResult, PlaywrightAdapterOptions, PlaywrightAnnotation, PlaywrightAttachment, PlaywrightError, PlaywrightLocation, PlaywrightStatus, PlaywrightTestCase, PlaywrightTestResult, StoryFileReport, VitestAdapterOptions, VitestSerializedError, VitestState, VitestTestCase, VitestTestModule, VitestTestResult } from './adapters.cjs';
9
9
  export { OtelAttributeValue, OtelSpan } from 'executable-stories-core/types/otel';
10
10
  import { RawCIInfo } from 'executable-stories-core/types/raw';
11
- export { RawAttachment, RawCIInfo, RawRun, RawStatus, RawStepEvent, RawTestCase } from 'executable-stories-core/types/raw';
11
+ export { RawAttachment, RawCIInfo, RawFeature, RawGlossaryTerm, RawRun, RawStatus, RawStepEvent, RawTestCase } from 'executable-stories-core/types/raw';
12
12
  import { StoryReport, TestStatus as TestStatus$1, ReportStep } from 'executable-stories-core/types/story-report';
13
13
  export { ReportAttachment, ReportCIInfo, ReportCoverageSummary, ReportDocCode, ReportDocCustom, ReportDocEntry, ReportDocKv, ReportDocLink, ReportDocMermaid, ReportDocNote, ReportDocScreenshot, ReportDocSection, ReportDocTable, ReportDocTag, ReportFeature, ReportScenario, ReportStep, ReportSummary, ReportTicket, STORY_REPORT_SCHEMA_MAJOR, STORY_REPORT_SCHEMA_VERSION, StoryReport, StoryReportSchemaVersion } from 'executable-stories-core/types/story-report';
14
14
  export { ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES } from 'executable-stories-core/theme/tokens';
15
- export { canonicalizeRun, deriveStepResults, generateRunId, generateTestCaseId, mergeStepResults, normalizeStatus, resolveAttachment, resolveAttachments, slugify } from 'executable-stories-core/converters/acl/index';
15
+ export { canonicalizeRun } from 'executable-stories-core/converters/acl/canonicalize';
16
+ export { normalizeStatus } from 'executable-stories-core/converters/acl/status';
17
+ export { generateRunId, generateTestCaseId, slugify } from 'executable-stories-core/converters/acl/ids';
18
+ export { deriveStepResults, mergeStepResults } from 'executable-stories-core/converters/acl/steps';
19
+ export { resolveAttachment, resolveAttachments } from 'executable-stories-core/converters/acl/attachments';
16
20
  export { ValidationResult, assertValidRun, validateCanonicalRun } from 'executable-stories-core/converters/acl/validate';
17
21
  export { RunState, advanceState, initialRunState } from 'executable-stories-core';
18
22
  export { toStoryReport } from 'executable-stories-core/converters/story-report';
@@ -537,82 +541,6 @@ interface ResolvedFormatterOptions {
537
541
  allowMissingAssets: boolean;
538
542
  }
539
543
 
540
- type ScenarioChangeKind = "added" | "removed" | "renamed" | "moved" | "regressed" | "fixed" | "changed" | "unchanged";
541
- interface ScenarioChangeFlags {
542
- status: boolean;
543
- steps: boolean;
544
- docs: boolean;
545
- tags: boolean;
546
- tickets: boolean;
547
- source: boolean;
548
- duration: boolean;
549
- attachments: boolean;
550
- error: boolean;
551
- titlePath: boolean;
552
- }
553
- interface ScenarioSnapshot {
554
- id: string;
555
- scenario: string;
556
- sourceFile: string;
557
- sourceLine: number;
558
- status: TestStatus;
559
- durationMs: number;
560
- tags: string[];
561
- titlePath: string[];
562
- steps: StoryStep[];
563
- docs: DocEntry[];
564
- tickets: NormalizedTicket[];
565
- attachments: Attachment[];
566
- errorMessage?: string;
567
- }
568
- interface ScenarioDiff {
569
- kind: ScenarioChangeKind;
570
- id: string;
571
- scenario: string;
572
- sourceFile: string;
573
- sourceLine: number;
574
- baseline?: ScenarioSnapshot;
575
- current?: ScenarioSnapshot;
576
- flags: ScenarioChangeFlags;
577
- changedFields: string[];
578
- durationDeltaMs?: number;
579
- /** For `renamed`/`moved`: the baseline test-case id this behaviour was matched from. */
580
- previousId?: string;
581
- /** For `renamed`/`moved`: match confidence in 0..1 (1 = exact content fingerprint). */
582
- matchConfidence?: number;
583
- /** For `renamed`/`moved`: how the baseline/current pair was re-identified. */
584
- matchedBy?: "fingerprint" | "similarity";
585
- }
586
- interface RunDiffSummary {
587
- totalBaseline: number;
588
- totalCurrent: number;
589
- added: number;
590
- removed: number;
591
- /** Behaviours re-identified across a title change (content preserved). */
592
- renamed: number;
593
- /** Behaviours re-identified across a file move (content preserved). */
594
- moved: number;
595
- changed: number;
596
- regressed: number;
597
- fixed: number;
598
- unchanged: number;
599
- /**
600
- * Baseline scenarios skipped because the current run is partial and never
601
- * touched their source file. Always 0 for a full-run diff.
602
- */
603
- notRun: number;
604
- }
605
- interface RunDiffResult {
606
- baseline: TestRunResult;
607
- current: TestRunResult;
608
- summary: RunDiffSummary;
609
- scenarios: ScenarioDiff[];
610
- }
611
- type CompareFormat = "html" | "markdown" | "changelog";
612
- interface CompareFormatterOptions {
613
- title?: string;
614
- }
615
-
616
544
  /**
617
545
  * Cucumber JSON format types.
618
546
  *
@@ -727,7 +655,7 @@ interface IJsonFeature {
727
655
  * between them and a vendor API.
728
656
  *
729
657
  * Adding a provider is one file in `adapters/` plus one line in
730
- * `adapters/index.ts`, with no edits to `engine.ts`. If a new adapter forces an
658
+ * `adapters/registry.ts`, with no edits to `engine.ts`. If a new adapter forces an
731
659
  * engine change, this port is wrong and gets fixed then, on evidence.
732
660
  *
733
661
  * Every method except `listCases` is optional. A read-only provider implements
@@ -1289,6 +1217,82 @@ declare function renderPlan(analysis: SyncAnalysis, opts: {
1289
1217
  /** What actually happened, printed after a real run. */
1290
1218
  declare function renderApplyResult(result: SyncApplyResult): string;
1291
1219
 
1220
+ type ScenarioChangeKind = "added" | "removed" | "renamed" | "moved" | "regressed" | "fixed" | "changed" | "unchanged";
1221
+ interface ScenarioChangeFlags {
1222
+ status: boolean;
1223
+ steps: boolean;
1224
+ docs: boolean;
1225
+ tags: boolean;
1226
+ tickets: boolean;
1227
+ source: boolean;
1228
+ duration: boolean;
1229
+ attachments: boolean;
1230
+ error: boolean;
1231
+ titlePath: boolean;
1232
+ }
1233
+ interface ScenarioSnapshot {
1234
+ id: string;
1235
+ scenario: string;
1236
+ sourceFile: string;
1237
+ sourceLine: number;
1238
+ status: TestStatus;
1239
+ durationMs: number;
1240
+ tags: string[];
1241
+ titlePath: string[];
1242
+ steps: StoryStep[];
1243
+ docs: DocEntry[];
1244
+ tickets: NormalizedTicket[];
1245
+ attachments: Attachment[];
1246
+ errorMessage?: string;
1247
+ }
1248
+ interface ScenarioDiff {
1249
+ kind: ScenarioChangeKind;
1250
+ id: string;
1251
+ scenario: string;
1252
+ sourceFile: string;
1253
+ sourceLine: number;
1254
+ baseline?: ScenarioSnapshot;
1255
+ current?: ScenarioSnapshot;
1256
+ flags: ScenarioChangeFlags;
1257
+ changedFields: string[];
1258
+ durationDeltaMs?: number;
1259
+ /** For `renamed`/`moved`: the baseline test-case id this behaviour was matched from. */
1260
+ previousId?: string;
1261
+ /** For `renamed`/`moved`: match confidence in 0..1 (1 = exact content fingerprint). */
1262
+ matchConfidence?: number;
1263
+ /** For `renamed`/`moved`: how the baseline/current pair was re-identified. */
1264
+ matchedBy?: "fingerprint" | "similarity";
1265
+ }
1266
+ interface RunDiffSummary {
1267
+ totalBaseline: number;
1268
+ totalCurrent: number;
1269
+ added: number;
1270
+ removed: number;
1271
+ /** Behaviours re-identified across a title change (content preserved). */
1272
+ renamed: number;
1273
+ /** Behaviours re-identified across a file move (content preserved). */
1274
+ moved: number;
1275
+ changed: number;
1276
+ regressed: number;
1277
+ fixed: number;
1278
+ unchanged: number;
1279
+ /**
1280
+ * Baseline scenarios skipped because the current run is partial and never
1281
+ * touched their source file. Always 0 for a full-run diff.
1282
+ */
1283
+ notRun: number;
1284
+ }
1285
+ interface RunDiffResult {
1286
+ baseline: TestRunResult;
1287
+ current: TestRunResult;
1288
+ summary: RunDiffSummary;
1289
+ scenarios: ScenarioDiff[];
1290
+ }
1291
+ type CompareFormat = "html" | "markdown" | "changelog";
1292
+ interface CompareFormatterOptions {
1293
+ title?: string;
1294
+ }
1295
+
1292
1296
  /**
1293
1297
  * Diff types — parsed unified patches and content-anchored annotation targets.
1294
1298
  *
@@ -1808,6 +1812,82 @@ interface WatchHandle {
1808
1812
  */
1809
1813
  declare function startWatch(options: WatchOptions, deps?: WatchDeps): WatchHandle;
1810
1814
 
1815
+ interface AggregateDeps {
1816
+ readFile: (filePath: string) => string;
1817
+ listDir: (dir: string) => string[] | undefined;
1818
+ logger: {
1819
+ warn(msg: string): void;
1820
+ };
1821
+ }
1822
+ interface AggregateResult {
1823
+ run: TestRunResult;
1824
+ /** How many per-file reports went into it. */
1825
+ files: number;
1826
+ /** Reports that could not be parsed. Named, never silently skipped. */
1827
+ unreadable: string[];
1828
+ /** Scenario ids claimed by more than one report. */
1829
+ duplicateIds: string[];
1830
+ }
1831
+ /**
1832
+ * Read every per-file report in `dir` and combine them into one run.
1833
+ *
1834
+ * Returns undefined when the directory holds no reports, so a caller can tell
1835
+ * "nothing here yet" from "here is an empty run".
1836
+ */
1837
+ declare function aggregateReports(args: {
1838
+ dir: string;
1839
+ }, deps: AggregateDeps): AggregateResult | undefined;
1840
+
1841
+ interface RunsLifecycleDeps {
1842
+ readFile: (filePath: string) => string;
1843
+ listDir: (dir: string) => string[] | undefined;
1844
+ removeFile: (filePath: string) => void;
1845
+ logger: {
1846
+ warn(msg: string): void;
1847
+ };
1848
+ }
1849
+ /** What one test file's report looks like from the outside. */
1850
+ interface AccumulatedFile {
1851
+ sourceFile: string;
1852
+ scenarios: number;
1853
+ /** When this file's newest scenario last ran, or undefined if none say. */
1854
+ lastRunAtMs?: number;
1855
+ lastRunGitSha?: string;
1856
+ }
1857
+ interface RunsStatusReport {
1858
+ /** Path of the reports directory, for the reader to go look. */
1859
+ directory: string;
1860
+ exists: boolean;
1861
+ files: AccumulatedFile[];
1862
+ totalScenarios: number;
1863
+ /** Reports that could not be parsed. Named, never silently skipped. */
1864
+ unreadable: string[];
1865
+ /** Human-readable rendering, what the CLI prints. */
1866
+ text: string;
1867
+ }
1868
+ /**
1869
+ * What the report would be built from right now: every test file the state
1870
+ * holds, how many scenarios each contributes, and how old those results are.
1871
+ */
1872
+ declare function runsStatus(args: {
1873
+ outputDir: string;
1874
+ nowMs: number;
1875
+ }, deps: RunsLifecycleDeps): RunsStatusReport;
1876
+ interface RunsResetResult {
1877
+ directory: string;
1878
+ removed: number;
1879
+ text: string;
1880
+ }
1881
+ /**
1882
+ * Delete every per-file report. The next full test run writes them again.
1883
+ *
1884
+ * Removes only this directory's reports; anything rendered beside it in the
1885
+ * output folder is the user's own output and is left alone.
1886
+ */
1887
+ declare function runsReset(args: {
1888
+ outputDir: string;
1889
+ }, deps: RunsLifecycleDeps): RunsResetResult;
1890
+
1811
1891
  interface BehaviorDiffEntry {
1812
1892
  id: string;
1813
1893
  title: string;
@@ -1997,6 +2077,10 @@ declare class MarkdownFormatter {
1997
2077
  * Render scenarios grouped by file.
1998
2078
  */
1999
2079
  private renderByFile;
2080
+ /**
2081
+ * Render what a feature is for, ahead of the scenarios that prove it.
2082
+ */
2083
+ private renderFeatureDeclaration;
2000
2084
  /**
2001
2085
  * Render scenarios grouped by suite path.
2002
2086
  */
@@ -2717,6 +2801,19 @@ interface CheckFailure {
2717
2801
  /** True when this scenario was passing in the baseline run. */
2718
2802
  regressed: boolean;
2719
2803
  }
2804
+ /**
2805
+ * A scenario that is switched off: skipped or pending, but not `it.todo`.
2806
+ * A planned scenario is a spec waiting for code; a turned-off one is a spec
2807
+ * you stopped validating, and the pack forgets it exists unless it is named.
2808
+ */
2809
+ interface CheckTurnedOff {
2810
+ id: string;
2811
+ scenario: string;
2812
+ /** `sourceFile:sourceLine` */
2813
+ location: string;
2814
+ status: "skipped" | "pending";
2815
+ tickets: string[];
2816
+ }
2720
2817
  interface CheckReport {
2721
2818
  summary: {
2722
2819
  total: number;
@@ -2726,6 +2823,8 @@ interface CheckReport {
2726
2823
  pending: number;
2727
2824
  };
2728
2825
  failures: CheckFailure[];
2826
+ /** Scenarios switched off — named, not just counted (see {@link CheckTurnedOff}). */
2827
+ turnedOff: CheckTurnedOff[];
2729
2828
  /** Count of scenarios that went passed → failed vs. the baseline. */
2730
2829
  regressed: number;
2731
2830
  /** Count of scenarios that went failed → passed vs. the baseline. */
@@ -2844,7 +2943,134 @@ type TriageDeps = Record<string, never>;
2844
2943
  declare function buildTriage(args: TriageArgs, _deps?: TriageDeps): TriageReport;
2845
2944
  declare function renderTriage(report: TriageReport, format: "text" | "json"): string;
2846
2945
 
2847
- declare function createPrCommentSummary(diff: RunDiffResult, maxScenarios?: number): string;
2946
+ /**
2947
+ * ReportGenerator — turns a canonical TestRunResult into report files.
2948
+ *
2949
+ * Its own module rather than part of the package barrel: `watch.ts` needs the
2950
+ * generator, and reaching for it through `./index` would pull every formatter
2951
+ * and the React SSR path into that module's graph.
2952
+ */
2953
+
2954
+ /** Arguments for generate function */
2955
+ interface GenerateArgs {
2956
+ /** Canonical test run result */
2957
+ run: TestRunResult;
2958
+ /** Optional options override */
2959
+ options?: FormatterOptions;
2960
+ }
2961
+ /** Dependencies for generate function (injectable for testing) */
2962
+ interface GenerateDeps {
2963
+ /** Logger for warnings */
2964
+ logger: Logger;
2965
+ /** File writer function */
2966
+ writeFile: WriteFile;
2967
+ /** Read a file. Throws when it is not there, like `fs.readFileSync`. */
2968
+ readFile: (filePath: string) => string;
2969
+ /** List a directory's entries, or undefined when it is not one. */
2970
+ listDir: (dir: string) => string[] | undefined;
2971
+ /** True when the path is present in the working tree. */
2972
+ fileExists: (filePath: string) => boolean;
2973
+ /** Delete a file. Absent paths are not an error. */
2974
+ removeFile: (filePath: string) => Promise<void>;
2975
+ }
2976
+ /** Options for one `generate` call. */
2977
+ interface GenerateOptions {
2978
+ /**
2979
+ * Whether this run owns the reports of the files it covers and should update
2980
+ * them. True for a test run. False when rendering an already-assembled run,
2981
+ * such as the aggregate of a shard directory, which owns nothing.
2982
+ */
2983
+ persist?: boolean;
2984
+ }
2985
+ /** Result of generate function: Map of format to array of file paths */
2986
+ type GenerateResult = Map<OutputFormat, string[]>;
2987
+ interface GenerateCompareResult {
2988
+ files: string[];
2989
+ diff: RunDiffResult;
2990
+ }
2991
+ /**
2992
+ * Join an output name with a format extension, collapsing a stutter when the
2993
+ * chosen name already carries the format's tag. With the default name "index",
2994
+ * `story-report-json` writes `index.story-report.json`; but if the caller names
2995
+ * the file `story-report`, this yields `story-report.json`, not
2996
+ * `story-report.story-report.json`.
2997
+ */
2998
+ declare function joinNameAndExt(name: string, ext: string): string;
2999
+ /**
3000
+ * Normalise input formats to canonical {@link OutputFormat}s. Accepts the
3001
+ * deprecated `"astro"` alias (renamed to `"astro-markdown"`) and warns once per
3002
+ * process — so programmatic/config callers passing `"astro"` keep working
3003
+ * instead of throwing, matching the CLI's deprecation behaviour.
3004
+ */
3005
+ declare function normalizeFormats(formats: ReadonlyArray<FormatInput>): OutputFormat[];
3006
+ declare class ReportGenerator {
3007
+ private options;
3008
+ private deps;
3009
+ /**
3010
+ * The run the last `generate()` actually rendered: this run folded into what
3011
+ * previous runs accumulated. Callers that report on the output (the CLI's
3012
+ * summary line) need to describe what was written, not just what was handed
3013
+ * in. Undefined before the first generate.
3014
+ */
3015
+ private lastRenderedRun?;
3016
+ /**
3017
+ * What the execution formats rendered: this run after the same selection the
3018
+ * documentation set gets. The CLI counts whichever set its output actually
3019
+ * contains, so an excluded scenario is not reported as written.
3020
+ */
3021
+ private lastExecutedRun?;
3022
+ constructor(options?: FormatterOptions, deps?: Partial<GenerateDeps>);
3023
+ /** The run the last `generate()` rendered, stored reports included. */
3024
+ get renderedRun(): TestRunResult | undefined;
3025
+ /** What the last `generate()` handed the execution formats. */
3026
+ get executedRun(): TestRunResult | undefined;
3027
+ /**
3028
+ * Resolve options with defaults.
3029
+ */
3030
+ private resolveOptions;
3031
+ /**
3032
+ * Generate reports for a test run.
3033
+ *
3034
+ * @param run - Canonical TestRunResult (use canonicalizeRun to create from RawRun)
3035
+ * @returns Map of output format to generated file paths
3036
+ */
3037
+ generate(run: TestRunResult, options?: GenerateOptions): Promise<GenerateResult>;
3038
+ /**
3039
+ * Whether any output is colocated — the global mode, or any per-rule mode.
3040
+ * A colocated rule under a global aggregated mode still writes per-file
3041
+ * reports that need an index.
3042
+ */
3043
+ private hasColocatedOutput;
3044
+ /**
3045
+ * Write the entry-point page for a colocated HTML report tree. `htmlPaths` is
3046
+ * every HTML report already written this run. Returns the path written, or
3047
+ * undefined when there is nothing to index or the index would clobber a report
3048
+ * already at `index.html` — a colocated source file that produces it, or, in
3049
+ * mixed mode, the global aggregate (whose default output name is also index).
3050
+ */
3051
+ private writeColocatedIndex;
3052
+ /**
3053
+ * Generate reports for a single format.
3054
+ */
3055
+ private generateFormat;
3056
+ /**
3057
+ * Format content for a specific format.
3058
+ */
3059
+ private formatContent;
3060
+ /**
3061
+ * Render a standalone HTML report via the shared React component tree
3062
+ * (executable-stories-react). This is the same renderer the Astro docs site
3063
+ * uses, so the two outputs cannot drift. Imported lazily so React stays out
3064
+ * of the eager bundle unless this format is requested.
3065
+ */
3066
+ private formatHtmlReact;
3067
+ }
3068
+ /**
3069
+ * Factory function to create a ReportGenerator with dependency injection.
3070
+ *
3071
+ * Useful for testing and custom configurations.
3072
+ */
3073
+ declare function createReportGenerator(options?: FormatterOptions, deps?: Partial<GenerateDeps>): ReportGenerator;
2848
3074
 
2849
3075
  interface DiffRunsOptions {
2850
3076
  /**
@@ -2861,6 +3087,8 @@ interface DiffRunsOptions {
2861
3087
  }
2862
3088
  declare function diffRuns(baseline: TestRunResult, current: TestRunResult, options?: DiffRunsOptions): RunDiffResult;
2863
3089
 
3090
+ declare function createPrCommentSummary(diff: RunDiffResult, maxScenarios?: number): string;
3091
+
2864
3092
  /**
2865
3093
  * Review domain — `buildReview(run, context)` mirrors `diffRuns(baseline, current)`.
2866
3094
  *
@@ -3239,92 +3467,6 @@ declare function toTraceabilityMatrix(run: TestRunResult): TraceabilityMatrix;
3239
3467
  * HTML report renders via executable-stories-react — the `html` format)
3240
3468
  */
3241
3469
 
3242
- /** Arguments for generate function */
3243
- interface GenerateArgs {
3244
- /** Canonical test run result */
3245
- run: TestRunResult;
3246
- /** Optional options override */
3247
- options?: FormatterOptions;
3248
- }
3249
- /** Dependencies for generate function (injectable for testing) */
3250
- interface GenerateDeps {
3251
- /** Logger for warnings */
3252
- logger: Logger;
3253
- /** File writer function */
3254
- writeFile: WriteFile;
3255
- }
3256
- /** Result of generate function: Map of format to array of file paths */
3257
- type GenerateResult = Map<OutputFormat, string[]>;
3258
- interface GenerateCompareResult {
3259
- files: string[];
3260
- diff: RunDiffResult;
3261
- }
3262
- /**
3263
- * Join an output name with a format extension, collapsing a stutter when the
3264
- * chosen name already carries the format's tag. With the default name "index",
3265
- * `story-report-json` writes `index.story-report.json`; but if the caller names
3266
- * the file `story-report`, this yields `story-report.json`, not
3267
- * `story-report.story-report.json`.
3268
- */
3269
- declare function joinNameAndExt(name: string, ext: string): string;
3270
- /**
3271
- * Normalise input formats to canonical {@link OutputFormat}s. Accepts the
3272
- * deprecated `"astro"` alias (renamed to `"astro-markdown"`) and warns once per
3273
- * process — so programmatic/config callers passing `"astro"` keep working
3274
- * instead of throwing, matching the CLI's deprecation behaviour.
3275
- */
3276
- declare function normalizeFormats(formats: ReadonlyArray<FormatInput>): OutputFormat[];
3277
- declare class ReportGenerator {
3278
- private options;
3279
- private deps;
3280
- constructor(options?: FormatterOptions, deps?: Partial<GenerateDeps>);
3281
- /**
3282
- * Resolve options with defaults.
3283
- */
3284
- private resolveOptions;
3285
- /**
3286
- * Generate reports for a test run.
3287
- *
3288
- * @param run - Canonical TestRunResult (use canonicalizeRun to create from RawRun)
3289
- * @returns Map of output format to generated file paths
3290
- */
3291
- generate(run: TestRunResult): Promise<GenerateResult>;
3292
- /**
3293
- * Whether any output is colocated — the global mode, or any per-rule mode.
3294
- * A colocated rule under a global aggregated mode still writes per-file
3295
- * reports that need an index.
3296
- */
3297
- private hasColocatedOutput;
3298
- /**
3299
- * Write the entry-point page for a colocated HTML report tree. `htmlPaths` is
3300
- * every HTML report already written this run. Returns the path written, or
3301
- * undefined when there is nothing to index or the index would clobber a report
3302
- * already at `index.html` — a colocated source file that produces it, or, in
3303
- * mixed mode, the global aggregate (whose default output name is also index).
3304
- */
3305
- private writeColocatedIndex;
3306
- /**
3307
- * Generate reports for a single format.
3308
- */
3309
- private generateFormat;
3310
- /**
3311
- * Format content for a specific format.
3312
- */
3313
- private formatContent;
3314
- /**
3315
- * Render a standalone HTML report via the shared React component tree
3316
- * (executable-stories-react). This is the same renderer the Astro docs site
3317
- * uses, so the two outputs cannot drift. Imported lazily so React stays out
3318
- * of the eager bundle unless this format is requested.
3319
- */
3320
- private formatHtmlReact;
3321
- }
3322
- /**
3323
- * Factory function to create a ReportGenerator with dependency injection.
3324
- *
3325
- * Useful for testing and custom configurations.
3326
- */
3327
- declare function createReportGenerator(options?: FormatterOptions, deps?: Partial<GenerateDeps>): ReportGenerator;
3328
3470
  declare function generateRunComparison(args: {
3329
3471
  baseline: TestRunResult;
3330
3472
  current: TestRunResult;
@@ -3355,4 +3497,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
3355
3497
  */
3356
3498
  declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
3357
3499
 
3358
- export { type AdapterDeps, AgentTextFormatter, type AnchorResolution, type AnchorState, type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, type AttachPolicy, type BehaviorDebuggerIssue, type BehaviorDiff, type BehaviorDiffEntry, type BehaviorManifest, BehaviorManifestJsonFormatter, type BehaviorManifestJsonOptions, type BehaviorSourceFile, type BehaviorTag, type BundleOptions, type BundleResult, type CaseBody, type CaseResult, type ChangeType, type ChangedFile, type ChangedFileReview, type CheckArgs, type CheckDeps, type CheckFailure, type CheckReport, type CheckStep, type CodeDiffAnnotation, type CodeDiffAnnotationInput, type CodeDiffEvidence, type CodeDiffInput, type CodeDiffScenarioRef, type CodeDiffSidecar, type CodeDiffSidecarAnnotation, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, type CoverageClass, type CoverageJson, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, DEFAULT_LOCKFILE_PATH, type DeploymentEntry, type DeploymentLedger, type DeploymentStatus, type DiffAnchor, type DiffHunk, type DiffLine, type DiffRunsOptions, type EnvironmentDrift, type EvidenceStrength, type ExecutableStoriesConfig, type FetchFn, type FileChangeKind, type FileDiff, type FlakinessLevel, type Formatter, type FormatterOptions, type GenerateArgs, type GenerateCompareResult, type GenerateDeps, type GenerateResult, type GenericWebhookNotifierOptions, type GoalArgs, type GoalDeps, type GoalReport, type GoalRequirementResult, type HistoryEntry, type HistoryStore, type IJsonDataTable, type IJsonDocString, type IJsonEmbedding, type IJsonFeature, type IJsonScenario, type IJsonStep, type IJsonStepArgument, type IJsonStepResult, type IJsonTableRow, type IJsonTag, JUnitFormatter, type JUnitOptions, type JiraAuth, type JiraPublishMode, type ListScenariosArgs, type ListScenariosDeps, type LockEntry, type Lockfile, type Logger, MIN_FLAKINESS_SAMPLES, MIN_METRIC_SAMPLES, MIN_PERF_SAMPLES, MarkdownFormatter, type MarkdownFormatterOptions, type MarkdownOptions, type MarkdownRenderers, type NotificationSummary, type NotifyCondition, type OutputConfig, type OutputFormat, type OutputMode, type OutputRule, PROVIDER_NAMES, type PerformanceTrend, type ProviderName, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, type RatchetViolation, type RecordDeploymentArgs, type RecordDeploymentResult, type RecordResultsSummary, type ReleaseManifest, ReleaseManifestFormatter, type RemoteCase, ReportGenerator, type ResolvedFormatterOptions, type ResultAttachment, type ReviewAudience, type ReviewBand, type ReviewClaim, type ReviewContext, ReviewHtmlFormatter, type ReviewHtmlOptions, ReviewMarkdownFormatter, type ReviewMarkdownOptions, type ReviewResult, type ReviewSummary, RunDiffChangelogFormatter, type RunDiffChangelogOptions, RunDiffHtmlFormatter, type RunDiffHtmlOptions, RunDiffMarkdownFormatter, type RunDiffMarkdownOptions, type RunDiffResult, type RunDiffSummary, type ScenarioChangeFlags, type ScenarioChangeKind, type ScenarioDiff, type ScenarioIndex, type ScenarioIndexFilters, type ScenarioIndexItem, ScenarioIndexJsonFormatter, type ScenarioIndexJsonOptions, type ScenarioIndexStep, type ScenarioSnapshot, type SortTestCasesMode, type StabilityGrade, type StarlightBadge, StoryReportJsonFormatter, type StoryReportJsonOptions, type SyncAnalysis, type SyncApplyResult, type SyncEngineConfig, type SyncProvider, type SyncTargets, type TestHistory, type TestMetrics, type TestRailConfig, TraceabilityCsvFormatter, type TraceabilityMatrix, TraceabilityMatrixFormatter, type TraceabilityRequirement, type TriageArgs, type TriageDeps, type TriageItem, type TriageReport, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, type XrayConfig, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, analyzeSync, applySync, assembleCodeDiff, buildCheck, buildCoverageJson, buildGoal, buildProvider, buildReview, buildTriage, bundleAssets, calculateFlakiness, calculateStability, classifyStatusChange, clearVersionCache, codeDiffDiagnostics, collectAttachments, computeTestMetrics, copyMarkdownAssets, createAnchor, createPrCommentSummary, createReportGenerator, createTestRailProvider, createXrayProvider, deriveAudience, deriveChangeType, detectCI, detectPerformanceTrend, diffRuns, diffStoryReports, emptyLockfile, findGitDir, generateRunComparison, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, hashCaseBody, isProviderName, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, normalizeFormats, normalizeJestResults, normalizePlaywrightResults, normalizeVitestResults, parseLockfile, parseUnifiedDiff, projectBehaviours, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readLockfile, readPackageVersion, recordDeployment, regenerateArtifacts, regenerateRun, relocateAnchor, renderApplyResult, renderCheck, renderCoverageMarkdown, renderCoverageText, renderGoal, renderPlan, renderTriage, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, serializeLockfile, signBody, startWatch, stripAnsi, toAgentText, toBehaviorManifest, toCaseBody, toReleaseManifest, toScenarioIndex, toTraceabilityMatrix, updateHistory, writeLockfile };
3500
+ export { type AdapterDeps, AgentTextFormatter, type AggregateDeps, type AggregateResult, type AnchorResolution, type AnchorState, type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, type AttachPolicy, type BehaviorDebuggerIssue, type BehaviorDiff, type BehaviorDiffEntry, type BehaviorManifest, BehaviorManifestJsonFormatter, type BehaviorManifestJsonOptions, type BehaviorSourceFile, type BehaviorTag, type BundleOptions, type BundleResult, type CaseBody, type CaseResult, type ChangeType, type ChangedFile, type ChangedFileReview, type CheckArgs, type CheckDeps, type CheckFailure, type CheckReport, type CheckStep, type CodeDiffAnnotation, type CodeDiffAnnotationInput, type CodeDiffEvidence, type CodeDiffInput, type CodeDiffScenarioRef, type CodeDiffSidecar, type CodeDiffSidecarAnnotation, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, type CoverageClass, type CoverageJson, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, DEFAULT_LOCKFILE_PATH, type DeploymentEntry, type DeploymentLedger, type DeploymentStatus, type DiffAnchor, type DiffHunk, type DiffLine, type DiffRunsOptions, type EnvironmentDrift, type EvidenceStrength, type ExecutableStoriesConfig, type FetchFn, type FileChangeKind, type FileDiff, type FlakinessLevel, type Formatter, type FormatterOptions, type GenerateArgs, type GenerateCompareResult, type GenerateDeps, type GenerateResult, type GenericWebhookNotifierOptions, type GoalArgs, type GoalDeps, type GoalReport, type GoalRequirementResult, type HistoryEntry, type HistoryStore, type IJsonDataTable, type IJsonDocString, type IJsonEmbedding, type IJsonFeature, type IJsonScenario, type IJsonStep, type IJsonStepArgument, type IJsonStepResult, type IJsonTableRow, type IJsonTag, JUnitFormatter, type JUnitOptions, type JiraAuth, type JiraPublishMode, type ListScenariosArgs, type ListScenariosDeps, type LockEntry, type Lockfile, type Logger, MIN_FLAKINESS_SAMPLES, MIN_METRIC_SAMPLES, MIN_PERF_SAMPLES, MarkdownFormatter, type MarkdownFormatterOptions, type MarkdownOptions, type MarkdownRenderers, type NotificationSummary, type NotifyCondition, type OutputConfig, type OutputFormat, type OutputMode, type OutputRule, PROVIDER_NAMES, type PerformanceTrend, type ProviderName, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, type RatchetViolation, type RecordDeploymentArgs, type RecordDeploymentResult, type RecordResultsSummary, type ReleaseManifest, ReleaseManifestFormatter, type RemoteCase, ReportGenerator, type ResolvedFormatterOptions, type ResultAttachment, type ReviewAudience, type ReviewBand, type ReviewClaim, type ReviewContext, ReviewHtmlFormatter, type ReviewHtmlOptions, ReviewMarkdownFormatter, type ReviewMarkdownOptions, type ReviewResult, type ReviewSummary, RunDiffChangelogFormatter, type RunDiffChangelogOptions, RunDiffHtmlFormatter, type RunDiffHtmlOptions, RunDiffMarkdownFormatter, type RunDiffMarkdownOptions, type RunDiffResult, type RunDiffSummary, type RunsResetResult, type RunsStatusReport, type ScenarioChangeFlags, type ScenarioChangeKind, type ScenarioDiff, type ScenarioIndex, type ScenarioIndexFilters, type ScenarioIndexItem, ScenarioIndexJsonFormatter, type ScenarioIndexJsonOptions, type ScenarioIndexStep, type ScenarioSnapshot, type SortTestCasesMode, type StabilityGrade, type StarlightBadge, StoryReportJsonFormatter, type StoryReportJsonOptions, type SyncAnalysis, type SyncApplyResult, type SyncEngineConfig, type SyncProvider, type SyncTargets, type TestHistory, type TestMetrics, type TestRailConfig, TraceabilityCsvFormatter, type TraceabilityMatrix, TraceabilityMatrixFormatter, type TraceabilityRequirement, type TriageArgs, type TriageDeps, type TriageItem, type TriageReport, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, type XrayConfig, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, aggregateReports, analyzeSync, applySync, assembleCodeDiff, buildCheck, buildCoverageJson, buildGoal, buildProvider, buildReview, buildTriage, bundleAssets, calculateFlakiness, calculateStability, classifyStatusChange, clearVersionCache, codeDiffDiagnostics, collectAttachments, computeTestMetrics, copyMarkdownAssets, createAnchor, createPrCommentSummary, createReportGenerator, createTestRailProvider, createXrayProvider, deriveAudience, deriveChangeType, detectCI, detectPerformanceTrend, diffRuns, diffStoryReports, emptyLockfile, findGitDir, generateRunComparison, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, hashCaseBody, isProviderName, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, normalizeFormats, normalizeJestResults, normalizePlaywrightResults, normalizeVitestResults, parseLockfile, parseUnifiedDiff, projectBehaviours, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readLockfile, readPackageVersion, recordDeployment, regenerateArtifacts, regenerateRun, relocateAnchor, renderApplyResult, renderCheck, renderCoverageMarkdown, renderCoverageText, renderGoal, renderPlan, renderTriage, rewriteAssetPaths, runsReset, runsStatus, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, serializeLockfile, signBody, startWatch, stripAnsi, toAgentText, toBehaviorManifest, toCaseBody, toReleaseManifest, toScenarioIndex, toTraceabilityMatrix, updateHistory, writeLockfile };