executable-stories-formatters 1.9.1 → 1.9.2
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/adapters.d.cts +183 -1
- package/dist/adapters.d.ts +183 -1
- package/dist/cli.js +346 -1737
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +241 -1719
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -866
- package/dist/index.d.ts +43 -866
- package/dist/index.js +208 -1673
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/index-CmEmALo3.d.cts +0 -634
- package/dist/index-CmEmALo3.d.ts +0 -634
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
startedAtMs?: number;
|
|
27
|
-
/** Default finish time (epoch ms). Default: Date.now() */
|
|
28
|
-
finishedAtMs?: number;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
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';
|
|
3
|
+
import { StoryStep, DocEntry, NormalizedTicket, StepKeyword } from 'executable-stories-core/types/story';
|
|
4
|
+
export { DocEntry, DocPhase, NormalizedTicket, STORY_META_KEY, StepKeyword, StepMode, StoryMeta, StoryStep } from 'executable-stories-core/types/story';
|
|
5
|
+
import { CIInfo, CIProvider } from 'executable-stories-core/types/ci';
|
|
6
|
+
export { CIProvider, CIInfo as TypedCIInfo, toCIInfo, toRawCIInfo } from 'executable-stories-core/types/ci';
|
|
7
|
+
import { adaptJestRun, adaptPlaywrightRun, adaptVitestRun } from './adapters.js';
|
|
8
|
+
export { JestAdapterOptions, JestAggregatedResult, JestFileResult, JestTestResult, PlaywrightAdapterOptions, PlaywrightAnnotation, PlaywrightAttachment, PlaywrightError, PlaywrightLocation, PlaywrightStatus, PlaywrightTestCase, PlaywrightTestResult, StoryFileReport, VitestAdapterOptions, VitestSerializedError, VitestState, VitestTestCase, VitestTestModule, VitestTestResult } from './adapters.js';
|
|
9
|
+
export { OtelAttributeValue, OtelSpan } from 'executable-stories-core/types/otel';
|
|
10
|
+
import { RawCIInfo } from 'executable-stories-core/types/raw';
|
|
11
|
+
export { RawAttachment, RawCIInfo, RawRun, RawStatus, RawStepEvent, RawTestCase } from 'executable-stories-core/types/raw';
|
|
12
|
+
import { StoryReport, TestStatus as TestStatus$1, ReportStep } from 'executable-stories-core/types/story-report';
|
|
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
|
+
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';
|
|
16
|
+
export { ValidationResult, assertValidRun, validateCanonicalRun } from 'executable-stories-core/converters/acl/validate';
|
|
17
|
+
export { RunState, advanceState, initialRunState } from 'executable-stories-core';
|
|
18
|
+
export { toStoryReport } from 'executable-stories-core/converters/story-report';
|
|
19
|
+
import { Envelope } from 'executable-stories-core/types/cucumber-messages';
|
|
20
|
+
export { parseEnvelopes, parseNdjson } from 'executable-stories-core/converters/ndjson-parser';
|
|
21
|
+
export { formatDuration, msToNanoseconds, nanosecondsToMs } from 'executable-stories-core/utils/duration';
|
|
22
|
+
export { OtelTraceContext, resolveTraceUrl, tryGetActiveOtelContext } from 'executable-stories-core/utils/otel-detect';
|
|
23
|
+
export { HtmlDocOptions, buildHtmlDocEntry } from 'executable-stories-core/utils/doc-builders';
|
|
24
|
+
import { CanonicalizeOptions } from 'executable-stories-core/types/canonicalize';
|
|
25
|
+
export { CanonicalizeOptions } from 'executable-stories-core/types/canonicalize';
|
|
31
26
|
|
|
32
27
|
/**
|
|
33
28
|
* Notification types for webhook integrations (Slack, Teams).
|
|
@@ -45,7 +40,7 @@ interface NotificationSummary {
|
|
|
45
40
|
name: string;
|
|
46
41
|
error?: string;
|
|
47
42
|
}>;
|
|
48
|
-
ci?: CIInfo
|
|
43
|
+
ci?: CIInfo;
|
|
49
44
|
reportUrl?: string;
|
|
50
45
|
}
|
|
51
46
|
/** When to send notifications. */
|
|
@@ -560,7 +555,7 @@ interface ScenarioSnapshot {
|
|
|
560
555
|
scenario: string;
|
|
561
556
|
sourceFile: string;
|
|
562
557
|
sourceLine: number;
|
|
563
|
-
status: TestStatus
|
|
558
|
+
status: TestStatus;
|
|
564
559
|
durationMs: number;
|
|
565
560
|
tags: string[];
|
|
566
561
|
titlePath: string[];
|
|
@@ -732,216 +727,6 @@ interface ExecutableStoriesConfig {
|
|
|
732
727
|
formatters?: Record<string, Formatter>;
|
|
733
728
|
}
|
|
734
729
|
|
|
735
|
-
/**
|
|
736
|
-
* StoryReport — public, frozen contract for UI renderers.
|
|
737
|
-
*
|
|
738
|
-
* Distinct from internal TestRunResult. Pre-grouped feature → scenario tree,
|
|
739
|
-
* with pre-computed summaries at every level. Adapter concerns (rawStatus,
|
|
740
|
-
* projectName, titlePath) are stripped at the toStoryReport boundary.
|
|
741
|
-
*
|
|
742
|
-
* Versioning: semver-style "<major>.<minor>". Additive-only within a major.
|
|
743
|
-
* Source of truth: schemas/story-report-v1.json. Types here must stay in sync.
|
|
744
|
-
*/
|
|
745
|
-
|
|
746
|
-
type StoryReportSchemaVersion = `1.${number}`;
|
|
747
|
-
type TestStatus = "passed" | "failed" | "skipped" | "pending";
|
|
748
|
-
type StepKeyword = "Given" | "When" | "Then" | "And" | "But";
|
|
749
|
-
type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent";
|
|
750
|
-
interface ReportSummary {
|
|
751
|
-
total: number;
|
|
752
|
-
passed: number;
|
|
753
|
-
failed: number;
|
|
754
|
-
skipped: number;
|
|
755
|
-
pending: number;
|
|
756
|
-
durationMs: number;
|
|
757
|
-
}
|
|
758
|
-
interface ReportTicket {
|
|
759
|
-
id: string;
|
|
760
|
-
url?: string;
|
|
761
|
-
}
|
|
762
|
-
interface ReportAttachment {
|
|
763
|
-
name: string;
|
|
764
|
-
mediaType: string;
|
|
765
|
-
body: string;
|
|
766
|
-
contentEncoding: "BASE64" | "IDENTITY";
|
|
767
|
-
}
|
|
768
|
-
interface ReportCIInfo {
|
|
769
|
-
name: string;
|
|
770
|
-
url?: string;
|
|
771
|
-
buildNumber?: string;
|
|
772
|
-
branch?: string;
|
|
773
|
-
commitSha?: string;
|
|
774
|
-
prNumber?: string;
|
|
775
|
-
}
|
|
776
|
-
interface ReportCoverageSummary {
|
|
777
|
-
linesPct?: number;
|
|
778
|
-
branchesPct?: number;
|
|
779
|
-
functionsPct?: number;
|
|
780
|
-
statementsPct?: number;
|
|
781
|
-
}
|
|
782
|
-
type ReportDocEntry = ReportDocNote | ReportDocTag | ReportDocKv | ReportDocCode | ReportDocTable | ReportDocLink | ReportDocSection | ReportDocMermaid | ReportDocScreenshot | ReportDocVideo | ReportDocHtml | ReportDocState | ReportDocCustom;
|
|
783
|
-
interface ReportDocNote {
|
|
784
|
-
kind: "note";
|
|
785
|
-
text: string;
|
|
786
|
-
phase: DocPhase;
|
|
787
|
-
children?: ReportDocEntry[];
|
|
788
|
-
}
|
|
789
|
-
interface ReportDocTag {
|
|
790
|
-
kind: "tag";
|
|
791
|
-
names: string[];
|
|
792
|
-
phase: DocPhase;
|
|
793
|
-
children?: ReportDocEntry[];
|
|
794
|
-
}
|
|
795
|
-
interface ReportDocKv {
|
|
796
|
-
kind: "kv";
|
|
797
|
-
label: string;
|
|
798
|
-
value: unknown;
|
|
799
|
-
phase: DocPhase;
|
|
800
|
-
children?: ReportDocEntry[];
|
|
801
|
-
}
|
|
802
|
-
interface ReportDocCode {
|
|
803
|
-
kind: "code";
|
|
804
|
-
label: string;
|
|
805
|
-
content: string;
|
|
806
|
-
lang?: string;
|
|
807
|
-
phase: DocPhase;
|
|
808
|
-
children?: ReportDocEntry[];
|
|
809
|
-
}
|
|
810
|
-
interface ReportDocTable {
|
|
811
|
-
kind: "table";
|
|
812
|
-
label: string;
|
|
813
|
-
columns: string[];
|
|
814
|
-
rows: string[][];
|
|
815
|
-
phase: DocPhase;
|
|
816
|
-
children?: ReportDocEntry[];
|
|
817
|
-
}
|
|
818
|
-
interface ReportDocLink {
|
|
819
|
-
kind: "link";
|
|
820
|
-
label: string;
|
|
821
|
-
url: string;
|
|
822
|
-
phase: DocPhase;
|
|
823
|
-
children?: ReportDocEntry[];
|
|
824
|
-
}
|
|
825
|
-
interface ReportDocSection {
|
|
826
|
-
kind: "section";
|
|
827
|
-
title: string;
|
|
828
|
-
markdown: string;
|
|
829
|
-
phase: DocPhase;
|
|
830
|
-
children?: ReportDocEntry[];
|
|
831
|
-
}
|
|
832
|
-
interface ReportDocMermaid {
|
|
833
|
-
kind: "mermaid";
|
|
834
|
-
code: string;
|
|
835
|
-
title?: string;
|
|
836
|
-
phase: DocPhase;
|
|
837
|
-
children?: ReportDocEntry[];
|
|
838
|
-
}
|
|
839
|
-
interface ReportDocScreenshot {
|
|
840
|
-
kind: "screenshot";
|
|
841
|
-
path: string;
|
|
842
|
-
alt?: string;
|
|
843
|
-
phase: DocPhase;
|
|
844
|
-
children?: ReportDocEntry[];
|
|
845
|
-
}
|
|
846
|
-
interface ReportDocVideo {
|
|
847
|
-
kind: "video";
|
|
848
|
-
path: string;
|
|
849
|
-
caption?: string;
|
|
850
|
-
poster?: string;
|
|
851
|
-
phase: DocPhase;
|
|
852
|
-
children?: ReportDocEntry[];
|
|
853
|
-
}
|
|
854
|
-
interface ReportDocHtml {
|
|
855
|
-
kind: "html";
|
|
856
|
-
/** Local HTML file path (exactly one of path/url/content) */
|
|
857
|
-
path?: string;
|
|
858
|
-
/** Remote URL rendered via iframe src (exactly one of path/url/content) */
|
|
859
|
-
url?: string;
|
|
860
|
-
/** Inline HTML content rendered via iframe srcdoc (exactly one of path/url/content) */
|
|
861
|
-
content?: string;
|
|
862
|
-
title?: string;
|
|
863
|
-
/** Iframe height: number → px, string passed through (e.g. "60vh"). Default 400px. */
|
|
864
|
-
height?: number | string;
|
|
865
|
-
phase: DocPhase;
|
|
866
|
-
children?: ReportDocEntry[];
|
|
867
|
-
}
|
|
868
|
-
interface ReportDocState {
|
|
869
|
-
kind: "state";
|
|
870
|
-
/** Entity name ("Basket") — diff identity across steps. Unlabeled states share one lane. */
|
|
871
|
-
label?: string;
|
|
872
|
-
/** JSON-serializable snapshot of the state at this step. */
|
|
873
|
-
value: unknown;
|
|
874
|
-
phase: DocPhase;
|
|
875
|
-
children?: ReportDocEntry[];
|
|
876
|
-
}
|
|
877
|
-
interface ReportDocCustom {
|
|
878
|
-
kind: "custom";
|
|
879
|
-
type: string;
|
|
880
|
-
data: unknown;
|
|
881
|
-
phase: DocPhase;
|
|
882
|
-
children?: ReportDocEntry[];
|
|
883
|
-
}
|
|
884
|
-
interface ReportStep {
|
|
885
|
-
id: string;
|
|
886
|
-
index: number;
|
|
887
|
-
keyword: StepKeyword;
|
|
888
|
-
text: string;
|
|
889
|
-
status: TestStatus;
|
|
890
|
-
durationMs: number;
|
|
891
|
-
errorMessage?: string;
|
|
892
|
-
mode?: StepMode;
|
|
893
|
-
docEntries: ReportDocEntry[];
|
|
894
|
-
}
|
|
895
|
-
interface ReportScenario {
|
|
896
|
-
id: string;
|
|
897
|
-
title: string;
|
|
898
|
-
status: TestStatus;
|
|
899
|
-
/**
|
|
900
|
-
* True for scenarios authored with the framework's todo modifier
|
|
901
|
-
* (e.g. `it.todo`): specified behavior with no implementation yet.
|
|
902
|
-
* Canonical status stays "pending"; this flags why.
|
|
903
|
-
*/
|
|
904
|
-
planned?: boolean;
|
|
905
|
-
durationMs: number;
|
|
906
|
-
tags: string[];
|
|
907
|
-
tickets?: ReportTicket[];
|
|
908
|
-
/** Product-code paths/globs this scenario exercises (project-root-relative). */
|
|
909
|
-
covers?: string[];
|
|
910
|
-
sourceLine?: number;
|
|
911
|
-
errorMessage?: string;
|
|
912
|
-
errorStack?: string;
|
|
913
|
-
retry: number;
|
|
914
|
-
retries: number;
|
|
915
|
-
docEntries: ReportDocEntry[];
|
|
916
|
-
steps: ReportStep[];
|
|
917
|
-
attachments: ReportAttachment[];
|
|
918
|
-
/** OTel spans for the trace waterfall (carried through from the run). */
|
|
919
|
-
otelSpans?: OtelSpan[];
|
|
920
|
-
}
|
|
921
|
-
interface ReportFeature {
|
|
922
|
-
id: string;
|
|
923
|
-
title: string;
|
|
924
|
-
sourceFile: string;
|
|
925
|
-
summary: ReportSummary;
|
|
926
|
-
scenarios: ReportScenario[];
|
|
927
|
-
}
|
|
928
|
-
interface StoryReport {
|
|
929
|
-
schemaVersion: StoryReportSchemaVersion;
|
|
930
|
-
runId: string;
|
|
931
|
-
startedAtMs: number;
|
|
932
|
-
finishedAtMs: number;
|
|
933
|
-
durationMs: number;
|
|
934
|
-
projectRoot: string;
|
|
935
|
-
packageVersion?: string;
|
|
936
|
-
gitSha?: string;
|
|
937
|
-
ci?: ReportCIInfo;
|
|
938
|
-
coverage?: ReportCoverageSummary;
|
|
939
|
-
summary: ReportSummary;
|
|
940
|
-
features: ReportFeature[];
|
|
941
|
-
}
|
|
942
|
-
declare const STORY_REPORT_SCHEMA_VERSION: StoryReportSchemaVersion;
|
|
943
|
-
declare const STORY_REPORT_SCHEMA_MAJOR: 1;
|
|
944
|
-
|
|
945
730
|
/**
|
|
946
731
|
* Diff types — parsed unified patches and content-anchored annotation targets.
|
|
947
732
|
*
|
|
@@ -1101,7 +886,7 @@ interface CodeDiffScenarioRef {
|
|
|
1101
886
|
/** False = the cited scenario is not in this run — render as "unverified reference". */
|
|
1102
887
|
resolved: boolean;
|
|
1103
888
|
scenario?: string;
|
|
1104
|
-
status?: TestStatus
|
|
889
|
+
status?: TestStatus;
|
|
1105
890
|
}
|
|
1106
891
|
/** An annotation resolved against the parsed patch and the run. */
|
|
1107
892
|
interface CodeDiffAnnotation {
|
|
@@ -1135,7 +920,7 @@ interface ReviewClaim {
|
|
|
1135
920
|
sourceFile: string;
|
|
1136
921
|
sourceLine: number;
|
|
1137
922
|
/** Test outcome. */
|
|
1138
|
-
status: TestStatus
|
|
923
|
+
status: TestStatus;
|
|
1139
924
|
/** Derived from file convention / `audience:` tag. */
|
|
1140
925
|
audience: ReviewAudience;
|
|
1141
926
|
/** Declared via `change:*` tag (defaults to `unknown`). */
|
|
@@ -1188,239 +973,6 @@ interface ReviewResult {
|
|
|
1188
973
|
codeDiffs: CodeDiffEvidence[];
|
|
1189
974
|
}
|
|
1190
975
|
|
|
1191
|
-
/**
|
|
1192
|
-
* Canonical executable-stories theme tokens (--es-*).
|
|
1193
|
-
*
|
|
1194
|
-
* Source of truth for the `--es-color-*`, `--es-space-*`, `--es-font-*`,
|
|
1195
|
-
* `--es-size-*`, `--es-radius`, `--es-line`, and `--es-measure` CSS custom
|
|
1196
|
-
* properties consumed by:
|
|
1197
|
-
*
|
|
1198
|
-
* - executable-stories-react (styles.css)
|
|
1199
|
-
* - executable-stories-formatters HTML report (CSS_STYLES, via this module)
|
|
1200
|
-
*
|
|
1201
|
-
* Consumer-side overrides on `:root` or any ancestor of the report cascade
|
|
1202
|
-
* through both: setting `--es-color-failed: red` on body re-colors failures
|
|
1203
|
-
* in both the standalone HTML report and the React component.
|
|
1204
|
-
*
|
|
1205
|
-
* The HTML formatter's pre-existing tokens (--success, --error, etc.)
|
|
1206
|
-
* remain in place for backward compatibility; the --es-* tokens are emitted
|
|
1207
|
-
* alongside them as the public override surface.
|
|
1208
|
-
*/
|
|
1209
|
-
declare const ES_THEME_TOKENS_CSS: string;
|
|
1210
|
-
/**
|
|
1211
|
-
* JS-level mirror of the token values (for cases where TypeScript code needs
|
|
1212
|
-
* to read them — e.g., dynamic style injection or theme generators).
|
|
1213
|
-
*/
|
|
1214
|
-
declare const ES_THEME_TOKEN_VALUES: {
|
|
1215
|
-
readonly light: {
|
|
1216
|
-
readonly "--es-color-bg": "#ffffff";
|
|
1217
|
-
readonly "--es-color-fg": "#111827";
|
|
1218
|
-
readonly "--es-color-muted": "#6b7280";
|
|
1219
|
-
readonly "--es-color-border": "#e5e7eb";
|
|
1220
|
-
readonly "--es-color-surface": "#f9fafb";
|
|
1221
|
-
readonly "--es-color-link": "#2563eb";
|
|
1222
|
-
readonly "--es-color-passed": "#16a34a";
|
|
1223
|
-
readonly "--es-color-failed": "#dc2626";
|
|
1224
|
-
readonly "--es-color-skipped": "#9ca3af";
|
|
1225
|
-
readonly "--es-color-pending": "#d97706";
|
|
1226
|
-
};
|
|
1227
|
-
readonly dark: {
|
|
1228
|
-
readonly "--es-color-bg": "#0b0f17";
|
|
1229
|
-
readonly "--es-color-fg": "#e5e7eb";
|
|
1230
|
-
readonly "--es-color-muted": "#9ca3af";
|
|
1231
|
-
readonly "--es-color-border": "#1f2937";
|
|
1232
|
-
readonly "--es-color-surface": "#111827";
|
|
1233
|
-
readonly "--es-color-link": "#60a5fa";
|
|
1234
|
-
readonly "--es-color-passed": "#4ade80";
|
|
1235
|
-
readonly "--es-color-failed": "#f87171";
|
|
1236
|
-
readonly "--es-color-skipped": "#6b7280";
|
|
1237
|
-
readonly "--es-color-pending": "#fbbf24";
|
|
1238
|
-
};
|
|
1239
|
-
};
|
|
1240
|
-
|
|
1241
|
-
/**
|
|
1242
|
-
* Status mapping from raw framework statuses to canonical TestStatus.
|
|
1243
|
-
*/
|
|
1244
|
-
|
|
1245
|
-
/**
|
|
1246
|
-
* Convert a raw status to canonical TestStatus.
|
|
1247
|
-
*
|
|
1248
|
-
* @param raw - The raw status from a framework
|
|
1249
|
-
* @returns The canonical TestStatus
|
|
1250
|
-
*/
|
|
1251
|
-
declare function normalizeStatus(raw: RawStatus): TestStatus$1;
|
|
1252
|
-
|
|
1253
|
-
/**
|
|
1254
|
-
* ID generation and slug helpers for deterministic, Cucumber-compatible IDs.
|
|
1255
|
-
*/
|
|
1256
|
-
/**
|
|
1257
|
-
* Generate a deterministic test case ID from source file and scenario name.
|
|
1258
|
-
*
|
|
1259
|
-
* @param sourceFile - The source file path
|
|
1260
|
-
* @param scenario - The scenario name
|
|
1261
|
-
* @returns A 12-character hex ID
|
|
1262
|
-
*/
|
|
1263
|
-
declare function generateTestCaseId(sourceFile: string, scenario: string): string;
|
|
1264
|
-
/**
|
|
1265
|
-
* Generate a deterministic run ID from timestamp and project root.
|
|
1266
|
-
*
|
|
1267
|
-
* @param startedAtMs - Run start timestamp
|
|
1268
|
-
* @param projectRoot - Project root directory
|
|
1269
|
-
* @returns A 16-character hex ID
|
|
1270
|
-
*/
|
|
1271
|
-
declare function generateRunId(startedAtMs: number, projectRoot: string): string;
|
|
1272
|
-
/**
|
|
1273
|
-
* Slugify a string for Cucumber JSON IDs.
|
|
1274
|
-
*
|
|
1275
|
-
* Converts to lowercase, replaces path separators/spaces with hyphens,
|
|
1276
|
-
* removes other special chars, and trims leading/trailing hyphens.
|
|
1277
|
-
*
|
|
1278
|
-
* @param text - The text to slugify
|
|
1279
|
-
* @returns A URL-safe slug
|
|
1280
|
-
*/
|
|
1281
|
-
declare function slugify(text: string): string;
|
|
1282
|
-
|
|
1283
|
-
/**
|
|
1284
|
-
* Step fallback rules for deriving step results from scenario status.
|
|
1285
|
-
*
|
|
1286
|
-
* When frameworks don't provide step-level results, we derive them
|
|
1287
|
-
* from the overall scenario status using these rules.
|
|
1288
|
-
*/
|
|
1289
|
-
|
|
1290
|
-
/**
|
|
1291
|
-
* Derive step results from story steps and scenario status.
|
|
1292
|
-
*
|
|
1293
|
-
* Rules:
|
|
1294
|
-
* - Passed: All steps are passed
|
|
1295
|
-
* - Skipped/Pending: All steps are skipped/pending
|
|
1296
|
-
* - Failed: Steps up to failure are passed, failing step is failed, rest are skipped
|
|
1297
|
-
* (Heuristic: last step is the failure, or use error info if available)
|
|
1298
|
-
*
|
|
1299
|
-
* @param steps - Story steps with keywords and text
|
|
1300
|
-
* @param scenarioStatus - Overall scenario status
|
|
1301
|
-
* @param error - Optional error information to help identify failing step
|
|
1302
|
-
* @returns Array of step results
|
|
1303
|
-
*/
|
|
1304
|
-
declare function deriveStepResults(steps: StoryStep[], scenarioStatus: TestStatus$1, error?: {
|
|
1305
|
-
message?: string;
|
|
1306
|
-
stack?: string;
|
|
1307
|
-
}): StepResult[];
|
|
1308
|
-
/**
|
|
1309
|
-
* Merge raw step events with derived step results.
|
|
1310
|
-
*
|
|
1311
|
-
* When we have partial step data from the framework, merge it with
|
|
1312
|
-
* the derived results, preferring actual data over derived.
|
|
1313
|
-
*
|
|
1314
|
-
* @param derived - Derived step results from fallback rules
|
|
1315
|
-
* @param events - Raw step events from framework (if any)
|
|
1316
|
-
* @returns Merged step results
|
|
1317
|
-
*/
|
|
1318
|
-
declare function mergeStepResults(derived: StepResult[], events?: Array<{
|
|
1319
|
-
index?: number;
|
|
1320
|
-
stepId?: string;
|
|
1321
|
-
status?: string;
|
|
1322
|
-
durationMs?: number;
|
|
1323
|
-
errorMessage?: string;
|
|
1324
|
-
}>): StepResult[];
|
|
1325
|
-
|
|
1326
|
-
/**
|
|
1327
|
-
* Attachment resolution: embed vs link decision.
|
|
1328
|
-
*
|
|
1329
|
-
* Attachments can either be embedded inline (base64) or linked to
|
|
1330
|
-
* external files based on size thresholds.
|
|
1331
|
-
*/
|
|
1332
|
-
|
|
1333
|
-
/** Options for attachment resolution */
|
|
1334
|
-
interface AttachmentOptions {
|
|
1335
|
-
/** Max bytes before attachment becomes external link. Default: 512KB */
|
|
1336
|
-
maxEmbedBytes?: number;
|
|
1337
|
-
/** Directory for external attachments */
|
|
1338
|
-
externalDir?: string;
|
|
1339
|
-
/** Project root for relative paths */
|
|
1340
|
-
projectRoot?: string;
|
|
1341
|
-
}
|
|
1342
|
-
/**
|
|
1343
|
-
* Resolve a raw attachment to a canonical attachment.
|
|
1344
|
-
*
|
|
1345
|
-
* Decision logic:
|
|
1346
|
-
* 1. If body is already provided, use it (check size for encoding decision)
|
|
1347
|
-
* 2. If path is provided, read file and decide embed vs link
|
|
1348
|
-
* 3. For large files, return a URL reference instead of embedding
|
|
1349
|
-
*
|
|
1350
|
-
* @param raw - Raw attachment from framework
|
|
1351
|
-
* @param options - Resolution options
|
|
1352
|
-
* @returns Resolved canonical attachment
|
|
1353
|
-
*/
|
|
1354
|
-
declare function resolveAttachment(raw: RawAttachment, options?: AttachmentOptions): Attachment;
|
|
1355
|
-
/**
|
|
1356
|
-
* Resolve multiple attachments.
|
|
1357
|
-
*
|
|
1358
|
-
* @param attachments - Raw attachments array
|
|
1359
|
-
* @param options - Resolution options
|
|
1360
|
-
* @returns Resolved canonical attachments
|
|
1361
|
-
*/
|
|
1362
|
-
declare function resolveAttachments(attachments: RawAttachment[] | undefined, options?: AttachmentOptions): Attachment[];
|
|
1363
|
-
|
|
1364
|
-
/**
|
|
1365
|
-
* Anti-Corruption Layer (ACL) - Layer 2.
|
|
1366
|
-
*
|
|
1367
|
-
* Transforms permissive RawRun data from framework adapters into
|
|
1368
|
-
* strict canonical TestRunResult for formatters.
|
|
1369
|
-
*/
|
|
1370
|
-
|
|
1371
|
-
/**
|
|
1372
|
-
* Canonicalize a raw run into a strict TestRunResult.
|
|
1373
|
-
*
|
|
1374
|
-
* This is the main entry point for the ACL. It:
|
|
1375
|
-
* - Enforces required fields with defaults
|
|
1376
|
-
* - Normalizes statuses to TestStatus enum
|
|
1377
|
-
* - Applies step fallback rules
|
|
1378
|
-
* - Resolves attachments (embed vs link)
|
|
1379
|
-
* - Generates deterministic IDs
|
|
1380
|
-
*
|
|
1381
|
-
* @param raw - Raw run data from a framework adapter
|
|
1382
|
-
* @param options - Canonicalization options
|
|
1383
|
-
* @returns Strict canonical TestRunResult
|
|
1384
|
-
*/
|
|
1385
|
-
declare function canonicalizeRun(raw: RawRun, options?: CanonicalizeOptions): TestRunResult;
|
|
1386
|
-
|
|
1387
|
-
/**
|
|
1388
|
-
* Validation helpers for canonical TestRunResult.
|
|
1389
|
-
*
|
|
1390
|
-
* Used in tests to verify ACL output meets all invariants.
|
|
1391
|
-
*/
|
|
1392
|
-
|
|
1393
|
-
/** Validation result */
|
|
1394
|
-
interface ValidationResult {
|
|
1395
|
-
/** Whether the run is valid */
|
|
1396
|
-
valid: boolean;
|
|
1397
|
-
/** List of validation errors */
|
|
1398
|
-
errors: string[];
|
|
1399
|
-
}
|
|
1400
|
-
/**
|
|
1401
|
-
* Validate a canonical TestRunResult.
|
|
1402
|
-
*
|
|
1403
|
-
* Checks:
|
|
1404
|
-
* - All required fields are present
|
|
1405
|
-
* - stepResults length matches story.steps length
|
|
1406
|
-
* - stepResults indexes are valid and unique
|
|
1407
|
-
* - Durations are non-negative
|
|
1408
|
-
* - Timestamps are valid
|
|
1409
|
-
*
|
|
1410
|
-
* @param run - The TestRunResult to validate
|
|
1411
|
-
* @returns Validation result with errors if any
|
|
1412
|
-
*/
|
|
1413
|
-
declare function validateCanonicalRun(run: TestRunResult): ValidationResult;
|
|
1414
|
-
/**
|
|
1415
|
-
* Assert that a run is valid, throwing if not.
|
|
1416
|
-
*
|
|
1417
|
-
* Useful in tests.
|
|
1418
|
-
*
|
|
1419
|
-
* @param run - The TestRunResult to validate
|
|
1420
|
-
* @throws Error if validation fails
|
|
1421
|
-
*/
|
|
1422
|
-
declare function assertValidRun(run: TestRunResult): void;
|
|
1423
|
-
|
|
1424
976
|
/**
|
|
1425
977
|
* Cucumber JSON Formatter - Layer 3.
|
|
1426
978
|
*
|
|
@@ -1546,7 +1098,7 @@ interface ScenarioIndexItem {
|
|
|
1546
1098
|
* `check-explainers` can detect drift. Status is deliberately excluded.
|
|
1547
1099
|
*/
|
|
1548
1100
|
hash: string;
|
|
1549
|
-
status: TestStatus;
|
|
1101
|
+
status: TestStatus$1;
|
|
1550
1102
|
feature: string;
|
|
1551
1103
|
sourceFile: string;
|
|
1552
1104
|
sourceLine?: number;
|
|
@@ -1569,13 +1121,13 @@ interface ScenarioIndexStep {
|
|
|
1569
1121
|
index: number;
|
|
1570
1122
|
keyword: ReportStep["keyword"];
|
|
1571
1123
|
text: string;
|
|
1572
|
-
status: TestStatus;
|
|
1124
|
+
status: TestStatus$1;
|
|
1573
1125
|
durationMs: number;
|
|
1574
1126
|
errorMessage?: string;
|
|
1575
1127
|
docKinds: string[];
|
|
1576
1128
|
}
|
|
1577
1129
|
interface ScenarioIndexFilters {
|
|
1578
|
-
statuses?: TestStatus[];
|
|
1130
|
+
statuses?: TestStatus$1[];
|
|
1579
1131
|
tags?: string[];
|
|
1580
1132
|
sourceFiles?: string[];
|
|
1581
1133
|
}
|
|
@@ -1694,367 +1246,13 @@ interface WatchHandle {
|
|
|
1694
1246
|
*/
|
|
1695
1247
|
declare function startWatch(options: WatchOptions, deps?: WatchDeps): WatchHandle;
|
|
1696
1248
|
|
|
1697
|
-
/**
|
|
1698
|
-
* Cucumber Messages types for NDJSON output.
|
|
1699
|
-
*
|
|
1700
|
-
* Minimal own types (no @cucumber/messages dependency) — consistent with
|
|
1701
|
-
* the project's zero-external-deps-at-runtime approach.
|
|
1702
|
-
*
|
|
1703
|
-
* Based on the Cucumber Messages protocol:
|
|
1704
|
-
* https://github.com/cucumber/messages
|
|
1705
|
-
*/
|
|
1706
|
-
/** Protobuf-style timestamp { seconds, nanos } */
|
|
1707
|
-
interface Timestamp {
|
|
1708
|
-
seconds: number;
|
|
1709
|
-
nanos: number;
|
|
1710
|
-
}
|
|
1711
|
-
/** Protobuf-style duration { seconds, nanos } */
|
|
1712
|
-
interface Duration {
|
|
1713
|
-
seconds: number;
|
|
1714
|
-
nanos: number;
|
|
1715
|
-
}
|
|
1716
|
-
/** Location in a source file */
|
|
1717
|
-
interface Location {
|
|
1718
|
-
line: number;
|
|
1719
|
-
column?: number;
|
|
1720
|
-
}
|
|
1721
|
-
interface Meta {
|
|
1722
|
-
protocolVersion: string;
|
|
1723
|
-
implementation: {
|
|
1724
|
-
name: string;
|
|
1725
|
-
version: string;
|
|
1726
|
-
};
|
|
1727
|
-
runtime: {
|
|
1728
|
-
name: string;
|
|
1729
|
-
version: string;
|
|
1730
|
-
};
|
|
1731
|
-
os: {
|
|
1732
|
-
name: string;
|
|
1733
|
-
};
|
|
1734
|
-
cpu: {
|
|
1735
|
-
name: string;
|
|
1736
|
-
};
|
|
1737
|
-
}
|
|
1738
|
-
interface Source {
|
|
1739
|
-
uri: string;
|
|
1740
|
-
data: string;
|
|
1741
|
-
mediaType: "text/x.cucumber.gherkin+plain";
|
|
1742
|
-
}
|
|
1743
|
-
interface Tag {
|
|
1744
|
-
location: Location;
|
|
1745
|
-
name: string;
|
|
1746
|
-
id: string;
|
|
1747
|
-
}
|
|
1748
|
-
type KeywordType = "Unknown" | "Context" | "Action" | "Outcome" | "Conjunction";
|
|
1749
|
-
interface DocString {
|
|
1750
|
-
location: Location;
|
|
1751
|
-
mediaType?: string;
|
|
1752
|
-
content: string;
|
|
1753
|
-
delimiter: string;
|
|
1754
|
-
}
|
|
1755
|
-
interface TableCell {
|
|
1756
|
-
location: Location;
|
|
1757
|
-
value: string;
|
|
1758
|
-
}
|
|
1759
|
-
interface TableRow {
|
|
1760
|
-
location: Location;
|
|
1761
|
-
cells: TableCell[];
|
|
1762
|
-
id: string;
|
|
1763
|
-
}
|
|
1764
|
-
interface DataTable {
|
|
1765
|
-
location: Location;
|
|
1766
|
-
rows: TableRow[];
|
|
1767
|
-
}
|
|
1768
|
-
interface Step {
|
|
1769
|
-
location: Location;
|
|
1770
|
-
keyword: string;
|
|
1771
|
-
keywordType: KeywordType;
|
|
1772
|
-
text: string;
|
|
1773
|
-
id: string;
|
|
1774
|
-
docString?: DocString;
|
|
1775
|
-
dataTable?: DataTable;
|
|
1776
|
-
}
|
|
1777
|
-
interface Scenario {
|
|
1778
|
-
location: Location;
|
|
1779
|
-
tags: Tag[];
|
|
1780
|
-
keyword: string;
|
|
1781
|
-
name: string;
|
|
1782
|
-
description: string;
|
|
1783
|
-
steps: Step[];
|
|
1784
|
-
id: string;
|
|
1785
|
-
}
|
|
1786
|
-
interface Background {
|
|
1787
|
-
location: Location;
|
|
1788
|
-
keyword: string;
|
|
1789
|
-
name: string;
|
|
1790
|
-
description: string;
|
|
1791
|
-
steps: Step[];
|
|
1792
|
-
id: string;
|
|
1793
|
-
}
|
|
1794
|
-
type FeatureChild = {
|
|
1795
|
-
background: Background;
|
|
1796
|
-
scenario?: undefined;
|
|
1797
|
-
} | {
|
|
1798
|
-
scenario: Scenario;
|
|
1799
|
-
background?: undefined;
|
|
1800
|
-
};
|
|
1801
|
-
interface Feature {
|
|
1802
|
-
location: Location;
|
|
1803
|
-
tags: Tag[];
|
|
1804
|
-
language: string;
|
|
1805
|
-
keyword: string;
|
|
1806
|
-
name: string;
|
|
1807
|
-
description: string;
|
|
1808
|
-
children: FeatureChild[];
|
|
1809
|
-
}
|
|
1810
|
-
interface GherkinDocument {
|
|
1811
|
-
uri: string;
|
|
1812
|
-
feature: Feature;
|
|
1813
|
-
}
|
|
1814
|
-
type PickleStepType = "Unknown" | "Context" | "Action" | "Outcome";
|
|
1815
|
-
interface PickleDocString {
|
|
1816
|
-
mediaType?: string;
|
|
1817
|
-
content: string;
|
|
1818
|
-
}
|
|
1819
|
-
interface PickleTableCell {
|
|
1820
|
-
value: string;
|
|
1821
|
-
}
|
|
1822
|
-
interface PickleTableRow {
|
|
1823
|
-
cells: PickleTableCell[];
|
|
1824
|
-
}
|
|
1825
|
-
interface PickleTable {
|
|
1826
|
-
rows: PickleTableRow[];
|
|
1827
|
-
}
|
|
1828
|
-
interface PickleStepArgument {
|
|
1829
|
-
docString?: PickleDocString;
|
|
1830
|
-
dataTable?: PickleTable;
|
|
1831
|
-
}
|
|
1832
|
-
interface PickleStep {
|
|
1833
|
-
astNodeIds: string[];
|
|
1834
|
-
id: string;
|
|
1835
|
-
type: PickleStepType;
|
|
1836
|
-
text: string;
|
|
1837
|
-
argument?: PickleStepArgument;
|
|
1838
|
-
}
|
|
1839
|
-
interface PickleTag {
|
|
1840
|
-
name: string;
|
|
1841
|
-
astNodeId: string;
|
|
1842
|
-
}
|
|
1843
|
-
interface Pickle {
|
|
1844
|
-
id: string;
|
|
1845
|
-
uri: string;
|
|
1846
|
-
name: string;
|
|
1847
|
-
language: string;
|
|
1848
|
-
steps: PickleStep[];
|
|
1849
|
-
tags: PickleTag[];
|
|
1850
|
-
astNodeIds: string[];
|
|
1851
|
-
}
|
|
1852
|
-
type TestStepResultStatus = "UNKNOWN" | "PASSED" | "SKIPPED" | "PENDING" | "UNDEFINED" | "AMBIGUOUS" | "FAILED";
|
|
1853
|
-
interface TestStepResult {
|
|
1854
|
-
duration: Duration;
|
|
1855
|
-
status: TestStepResultStatus;
|
|
1856
|
-
message?: string;
|
|
1857
|
-
}
|
|
1858
|
-
interface TestStep {
|
|
1859
|
-
id: string;
|
|
1860
|
-
pickleStepId?: string;
|
|
1861
|
-
stepDefinitionIds?: string[];
|
|
1862
|
-
}
|
|
1863
|
-
interface TestCase {
|
|
1864
|
-
id: string;
|
|
1865
|
-
pickleId: string;
|
|
1866
|
-
testSteps: TestStep[];
|
|
1867
|
-
}
|
|
1868
|
-
interface TestRunStarted {
|
|
1869
|
-
timestamp: Timestamp;
|
|
1870
|
-
}
|
|
1871
|
-
interface TestCaseStarted {
|
|
1872
|
-
id: string;
|
|
1873
|
-
testCaseId: string;
|
|
1874
|
-
timestamp: Timestamp;
|
|
1875
|
-
attempt: number;
|
|
1876
|
-
}
|
|
1877
|
-
interface TestStepStarted {
|
|
1878
|
-
testCaseStartedId: string;
|
|
1879
|
-
testStepId: string;
|
|
1880
|
-
timestamp: Timestamp;
|
|
1881
|
-
}
|
|
1882
|
-
interface TestStepFinished {
|
|
1883
|
-
testCaseStartedId: string;
|
|
1884
|
-
testStepId: string;
|
|
1885
|
-
testStepResult: TestStepResult;
|
|
1886
|
-
timestamp: Timestamp;
|
|
1887
|
-
}
|
|
1888
|
-
interface TestCaseFinished {
|
|
1889
|
-
testCaseStartedId: string;
|
|
1890
|
-
timestamp: Timestamp;
|
|
1891
|
-
willBeRetried: boolean;
|
|
1892
|
-
}
|
|
1893
|
-
interface TestRunFinished {
|
|
1894
|
-
timestamp: Timestamp;
|
|
1895
|
-
success: boolean;
|
|
1896
|
-
}
|
|
1897
|
-
type AttachmentContentEncoding = "IDENTITY" | "BASE64";
|
|
1898
|
-
interface CucumberAttachment {
|
|
1899
|
-
testCaseStartedId: string;
|
|
1900
|
-
testStepId?: string;
|
|
1901
|
-
body: string;
|
|
1902
|
-
mediaType: string;
|
|
1903
|
-
contentEncoding: AttachmentContentEncoding;
|
|
1904
|
-
}
|
|
1905
|
-
/**
|
|
1906
|
-
* Each NDJSON line is one Envelope with exactly one field set.
|
|
1907
|
-
*/
|
|
1908
|
-
type Envelope = {
|
|
1909
|
-
meta: Meta;
|
|
1910
|
-
} | {
|
|
1911
|
-
source: Source;
|
|
1912
|
-
} | {
|
|
1913
|
-
gherkinDocument: GherkinDocument;
|
|
1914
|
-
} | {
|
|
1915
|
-
pickle: Pickle;
|
|
1916
|
-
} | {
|
|
1917
|
-
testRunStarted: TestRunStarted;
|
|
1918
|
-
} | {
|
|
1919
|
-
testCase: TestCase;
|
|
1920
|
-
} | {
|
|
1921
|
-
testCaseStarted: TestCaseStarted;
|
|
1922
|
-
} | {
|
|
1923
|
-
testStepStarted: TestStepStarted;
|
|
1924
|
-
} | {
|
|
1925
|
-
testStepFinished: TestStepFinished;
|
|
1926
|
-
} | {
|
|
1927
|
-
testCaseFinished: TestCaseFinished;
|
|
1928
|
-
} | {
|
|
1929
|
-
testRunFinished: TestRunFinished;
|
|
1930
|
-
} | {
|
|
1931
|
-
attachment: CucumberAttachment;
|
|
1932
|
-
};
|
|
1933
|
-
|
|
1934
|
-
/**
|
|
1935
|
-
* Convert a canonical TestRunResult into a frozen-shape StoryReport for UI renderers.
|
|
1936
|
-
*/
|
|
1937
|
-
declare function toStoryReport(run: TestRunResult): StoryReport;
|
|
1938
|
-
|
|
1939
|
-
/**
|
|
1940
|
-
* NDJSON-to-TestRunResult parser.
|
|
1941
|
-
*
|
|
1942
|
-
* Parses Cucumber Messages NDJSON (one JSON envelope per line) back into
|
|
1943
|
-
* a TestRunResult suitable for rendering by HtmlFormatter or other formatters.
|
|
1944
|
-
*
|
|
1945
|
-
* This is the NDJSON compat path: it produces a minimal but sufficient
|
|
1946
|
-
* TestRunResult. Fields not present in the NDJSON stream are given
|
|
1947
|
-
* sensible defaults.
|
|
1948
|
-
*/
|
|
1949
|
-
|
|
1950
|
-
/**
|
|
1951
|
-
* Parse an NDJSON string into a TestRunResult.
|
|
1952
|
-
*
|
|
1953
|
-
* @param ndjson - NDJSON string (one JSON envelope per line)
|
|
1954
|
-
* @returns TestRunResult reconstructed from the envelopes
|
|
1955
|
-
*/
|
|
1956
|
-
declare function parseNdjson(ndjson: string): TestRunResult;
|
|
1957
|
-
/**
|
|
1958
|
-
* Parse an array of Envelope objects into a TestRunResult.
|
|
1959
|
-
*
|
|
1960
|
-
* @param envelopes - Array of Cucumber Messages envelopes
|
|
1961
|
-
* @returns TestRunResult reconstructed from the envelopes
|
|
1962
|
-
*/
|
|
1963
|
-
declare function parseEnvelopes(envelopes: Envelope[]): TestRunResult;
|
|
1964
|
-
|
|
1965
|
-
/**
|
|
1966
|
-
* Session trajectory primitive — the valuable part of the old `serve.ts`.
|
|
1967
|
-
*
|
|
1968
|
-
* Pins a session baseline (the first run observed) and folds each subsequent run
|
|
1969
|
-
* forward, so a docs/agent loop can show "how this run compares to where the
|
|
1970
|
-
* session started" rather than just the noise between adjacent runs. Pure (no
|
|
1971
|
-
* I/O, no diff engine) so it lives in core and is consumable by the Astro
|
|
1972
|
-
* integration and the CLI alike. Diffing the runs is layered on top by the
|
|
1973
|
-
* consumer (the diff engine lives in the formatters package).
|
|
1974
|
-
*/
|
|
1975
|
-
|
|
1976
|
-
/**
|
|
1977
|
-
* The realtime state a live view renders. The session baseline is pinned to the
|
|
1978
|
-
* first run observed after boot, so the headline tracks the whole loop's
|
|
1979
|
-
* trajectory rather than the noise between any two adjacent iterations.
|
|
1980
|
-
*/
|
|
1981
|
-
interface RunState {
|
|
1982
|
-
/** First run observed this session — the trajectory anchor. */
|
|
1983
|
-
sessionBaseline: TestRunResult | null;
|
|
1984
|
-
/** The run immediately before {@link RunState.current} — the per-iteration anchor. */
|
|
1985
|
-
previous: TestRunResult | null;
|
|
1986
|
-
/** Latest run. */
|
|
1987
|
-
current: TestRunResult | null;
|
|
1988
|
-
/** How many runs have been observed since boot. */
|
|
1989
|
-
runCount: number;
|
|
1990
|
-
}
|
|
1991
|
-
/** The empty state before any run has been observed. */
|
|
1992
|
-
declare const initialRunState: RunState;
|
|
1993
|
-
/**
|
|
1994
|
-
* Fold a freshly-read run into the prior state. The first run pins the session
|
|
1995
|
-
* baseline; later runs shift `previous`/`current` forward. Pure.
|
|
1996
|
-
*/
|
|
1997
|
-
declare function advanceState(prev: RunState, run: TestRunResult): RunState;
|
|
1998
|
-
|
|
1999
|
-
/**
|
|
2000
|
-
* Canonical builders for doc entries whose construction carries a rule worth
|
|
2001
|
-
* keeping in one place. Adapters import these instead of re-implementing the
|
|
2002
|
-
* logic (the `html` exactly-one-of-source rule was previously copied verbatim
|
|
2003
|
-
* across the Vitest, Jest, Cypress, and Playwright adapters).
|
|
2004
|
-
*/
|
|
2005
|
-
|
|
2006
|
-
/** Source/presentation options for an `html` doc entry. */
|
|
2007
|
-
interface HtmlDocOptions {
|
|
2008
|
-
/** Local HTML file path (inlined into the report by default). */
|
|
2009
|
-
path?: string;
|
|
2010
|
-
/** Remote URL rendered via iframe src. */
|
|
2011
|
-
url?: string;
|
|
2012
|
-
/** Inline HTML content rendered via iframe srcdoc. */
|
|
2013
|
-
content?: string;
|
|
2014
|
-
title?: string;
|
|
2015
|
-
/** Iframe height: number → px, string passed through (e.g. '60vh'). Default 400px. */
|
|
2016
|
-
height?: number | string;
|
|
2017
|
-
}
|
|
2018
|
-
/**
|
|
2019
|
-
* Build an `html` DocEntry, enforcing that exactly one of path/url/content is
|
|
2020
|
-
* set. Throws otherwise — this is the single source of that rule.
|
|
2021
|
-
*/
|
|
2022
|
-
declare function buildHtmlDocEntry(options: HtmlDocOptions): DocEntry;
|
|
2023
|
-
|
|
2024
|
-
/**
|
|
2025
|
-
* Duration formatting utilities.
|
|
2026
|
-
*/
|
|
2027
|
-
/**
|
|
2028
|
-
* Format milliseconds as human-readable duration.
|
|
2029
|
-
*
|
|
2030
|
-
* @param ms - Duration in milliseconds
|
|
2031
|
-
* @returns Formatted string (e.g., "123 ms", "1.5 s", "2m 30s")
|
|
2032
|
-
*/
|
|
2033
|
-
declare function formatDuration(ms: number): string;
|
|
2034
|
-
/**
|
|
2035
|
-
* Convert milliseconds to nanoseconds.
|
|
2036
|
-
*
|
|
2037
|
-
* Used for Cucumber JSON format which expects nanoseconds.
|
|
2038
|
-
*
|
|
2039
|
-
* @param ms - Duration in milliseconds
|
|
2040
|
-
* @returns Duration in nanoseconds
|
|
2041
|
-
*/
|
|
2042
|
-
declare function msToNanoseconds(ms: number): number;
|
|
2043
|
-
/**
|
|
2044
|
-
* Convert nanoseconds to milliseconds.
|
|
2045
|
-
*
|
|
2046
|
-
* @param ns - Duration in nanoseconds
|
|
2047
|
-
* @returns Duration in milliseconds
|
|
2048
|
-
*/
|
|
2049
|
-
declare function nanosecondsToMs(ns: number): number;
|
|
2050
|
-
|
|
2051
1249
|
interface BehaviorDiffEntry {
|
|
2052
1250
|
id: string;
|
|
2053
1251
|
title: string;
|
|
2054
1252
|
sourceFile: string;
|
|
2055
1253
|
kind: ScenarioChangeKind;
|
|
2056
|
-
baselineStatus?: TestStatus;
|
|
2057
|
-
currentStatus?: TestStatus;
|
|
1254
|
+
baselineStatus?: TestStatus$1;
|
|
1255
|
+
currentStatus?: TestStatus$1;
|
|
2058
1256
|
}
|
|
2059
1257
|
interface BehaviorDiff {
|
|
2060
1258
|
schemaVersion: "1.0";
|
|
@@ -2072,7 +1270,7 @@ interface BehaviorDiff {
|
|
|
2072
1270
|
* Classify a single scenario's status transition between two runs.
|
|
2073
1271
|
* Shares the `ScenarioChangeKind` vocabulary with the full compare engine.
|
|
2074
1272
|
*/
|
|
2075
|
-
declare function classifyStatusChange(baseline: TestStatus | undefined, current: TestStatus | undefined): ScenarioChangeKind;
|
|
1273
|
+
declare function classifyStatusChange(baseline: TestStatus$1 | undefined, current: TestStatus$1 | undefined): ScenarioChangeKind;
|
|
2076
1274
|
/**
|
|
2077
1275
|
* Scenario-level diff of two StoryReports, keyed by scenario id. Reports status
|
|
2078
1276
|
* transitions (the agent triage signal), not the full field-by-field diff that
|
|
@@ -2631,27 +1829,6 @@ declare function clearVersionCache(): void;
|
|
|
2631
1829
|
*/
|
|
2632
1830
|
declare function detectCI(env?: Record<string, string | undefined>): RawCIInfo | undefined;
|
|
2633
1831
|
|
|
2634
|
-
/**
|
|
2635
|
-
* OTel trace context detection.
|
|
2636
|
-
*
|
|
2637
|
-
* Detects an active OpenTelemetry span via `@opentelemetry/api` (optional peer).
|
|
2638
|
-
* Uses `createRequire` so the import is lazy and never breaks if OTel isn't installed.
|
|
2639
|
-
*/
|
|
2640
|
-
interface OtelTraceContext {
|
|
2641
|
-
traceId: string;
|
|
2642
|
-
spanId: string;
|
|
2643
|
-
}
|
|
2644
|
-
/**
|
|
2645
|
-
* Try to read trace context from the currently-active OTel span.
|
|
2646
|
-
* Returns `undefined` when `@opentelemetry/api` is not installed or no span is active.
|
|
2647
|
-
*/
|
|
2648
|
-
declare function tryGetActiveOtelContext(): OtelTraceContext | undefined;
|
|
2649
|
-
/**
|
|
2650
|
-
* Replace `{traceId}` in a URL template.
|
|
2651
|
-
* Returns `undefined` when no template is provided.
|
|
2652
|
-
*/
|
|
2653
|
-
declare function resolveTraceUrl(template: string | undefined, traceId: string): string | undefined;
|
|
2654
|
-
|
|
2655
1832
|
/**
|
|
2656
1833
|
* Notification orchestrator.
|
|
2657
1834
|
*
|
|
@@ -2684,7 +1861,7 @@ interface SendNotificationsDeps {
|
|
|
2684
1861
|
logger: {
|
|
2685
1862
|
warn(msg: string): void;
|
|
2686
1863
|
};
|
|
2687
|
-
toCIInfo: (raw?: RawCIInfo) => CIInfo
|
|
1864
|
+
toCIInfo: (raw?: RawCIInfo) => CIInfo | undefined;
|
|
2688
1865
|
env?: Record<string, string | undefined>;
|
|
2689
1866
|
}
|
|
2690
1867
|
/**
|
|
@@ -2952,13 +2129,13 @@ declare function listScenarios(args: ListScenariosArgs, _deps: ListScenariosDeps
|
|
|
2952
2129
|
interface CheckArgs {
|
|
2953
2130
|
testCases: TestCaseResult[];
|
|
2954
2131
|
/** Baseline scenario statuses keyed by scenario id, for regressed/fixed deltas. */
|
|
2955
|
-
baseline?: Map<string, TestStatus
|
|
2132
|
+
baseline?: Map<string, TestStatus>;
|
|
2956
2133
|
format: "text" | "json";
|
|
2957
2134
|
}
|
|
2958
2135
|
type CheckDeps = Record<string, never>;
|
|
2959
2136
|
/** A single rendered step inside a failing scenario. */
|
|
2960
2137
|
interface CheckStep {
|
|
2961
|
-
keyword: StepKeyword
|
|
2138
|
+
keyword: StepKeyword;
|
|
2962
2139
|
text: string;
|
|
2963
2140
|
/** True when this step is the one that failed. */
|
|
2964
2141
|
failed: boolean;
|
|
@@ -3076,7 +2253,7 @@ interface TriageItem {
|
|
|
3076
2253
|
rank: number;
|
|
3077
2254
|
id: string;
|
|
3078
2255
|
scenario: string;
|
|
3079
|
-
status: TestStatus
|
|
2256
|
+
status: TestStatus;
|
|
3080
2257
|
/** `sourceFile:sourceLine` */
|
|
3081
2258
|
location: string;
|
|
3082
2259
|
/** Product-code paths to fix. Empty when the scenario declared no `covers`. */
|
|
@@ -3098,7 +2275,7 @@ interface TriageReport {
|
|
|
3098
2275
|
interface TriageArgs {
|
|
3099
2276
|
testCases: TestCaseResult[];
|
|
3100
2277
|
/** Baseline statuses by scenario id, to flag regressions and rank them first. */
|
|
3101
|
-
baseline?: Map<string, TestStatus
|
|
2278
|
+
baseline?: Map<string, TestStatus>;
|
|
3102
2279
|
format: "text" | "json";
|
|
3103
2280
|
}
|
|
3104
2281
|
type TriageDeps = Record<string, never>;
|
|
@@ -3439,7 +2616,7 @@ interface TraceabilityRequirement {
|
|
|
3439
2616
|
scenarios: Array<{
|
|
3440
2617
|
id: string;
|
|
3441
2618
|
title: string;
|
|
3442
|
-
status: TestStatus
|
|
2619
|
+
status: TestStatus;
|
|
3443
2620
|
sourceFile: string;
|
|
3444
2621
|
sourceLine: number;
|
|
3445
2622
|
covers: string[];
|
|
@@ -3468,7 +2645,7 @@ interface TraceabilityMatrix {
|
|
|
3468
2645
|
untraced: Array<{
|
|
3469
2646
|
id: string;
|
|
3470
2647
|
title: string;
|
|
3471
|
-
status: TestStatus
|
|
2648
|
+
status: TestStatus;
|
|
3472
2649
|
sourceFile: string;
|
|
3473
2650
|
sourceLine: number;
|
|
3474
2651
|
}>;
|
|
@@ -3616,4 +2793,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
|
|
|
3616
2793
|
*/
|
|
3617
2794
|
declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
|
|
3618
2795
|
|
|
3619
|
-
export { AgentTextFormatter, type AnchorResolution, type AnchorState, type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts,
|
|
2796
|
+
export { AgentTextFormatter, type AnchorResolution, type AnchorState, type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, type BehaviorDebuggerIssue, type BehaviorDiff, type BehaviorDiffEntry, type BehaviorManifest, BehaviorManifestJsonFormatter, type BehaviorManifestJsonOptions, type BehaviorSourceFile, type BehaviorTag, type BundleOptions, type BundleResult, 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, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, 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 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, type PerformanceTrend, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, type RatchetViolation, type RecordDeploymentArgs, type RecordDeploymentResult, type ReleaseManifest, ReleaseManifestFormatter, ReportGenerator, type ResolvedFormatterOptions, 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 TestHistory, type TestMetrics, 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, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, assembleCodeDiff, buildCheck, buildGoal, buildReview, buildTriage, bundleAssets, calculateFlakiness, calculateStability, classifyStatusChange, clearVersionCache, codeDiffDiagnostics, computeTestMetrics, copyMarkdownAssets, createAnchor, createPrCommentSummary, createReportGenerator, deriveAudience, deriveChangeType, detectCI, detectPerformanceTrend, diffRuns, diffStoryReports, findGitDir, generateRunComparison, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, normalizeFormats, normalizeJestResults, normalizePlaywrightResults, normalizeVitestResults, parseUnifiedDiff, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, recordDeployment, regenerateArtifacts, regenerateRun, relocateAnchor, renderCheck, renderGoal, renderTriage, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, startWatch, stripAnsi, toAgentText, toBehaviorManifest, toReleaseManifest, toScenarioIndex, toTraceabilityMatrix, updateHistory };
|