executable-stories-formatters 0.14.0 → 0.15.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/cli.js +305 -158
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +8 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -364,6 +364,8 @@ interface MarkdownFormatterOptions {
|
|
|
364
364
|
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
365
365
|
/** Render a badge line under a scenario heading (e.g. a what's-changed marker). Undefined to skip. */
|
|
366
366
|
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
367
|
+
/** Render a business-context link line under a scenario heading. Undefined to skip. */
|
|
368
|
+
scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
|
|
367
369
|
}
|
|
368
370
|
|
|
369
371
|
/** Astro/Starlight formatter options */
|
|
@@ -493,6 +495,7 @@ interface ResolvedFormatterOptions {
|
|
|
493
495
|
customRenderers?: MarkdownRenderers;
|
|
494
496
|
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
495
497
|
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
498
|
+
scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
|
|
496
499
|
};
|
|
497
500
|
};
|
|
498
501
|
assetMode: "none" | "copy";
|
|
@@ -1943,6 +1946,12 @@ interface MarkdownOptions {
|
|
|
1943
1946
|
* line, or undefined to skip. Off by default — only the living-docs site opts in.
|
|
1944
1947
|
*/
|
|
1945
1948
|
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
1949
|
+
/**
|
|
1950
|
+
* Render a link line under a scenario heading pointing at hand-written context
|
|
1951
|
+
* (the scenario's note page). Return the markdown line, or undefined to skip.
|
|
1952
|
+
* Off by default — only the living-docs site opts in.
|
|
1953
|
+
*/
|
|
1954
|
+
scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
|
|
1946
1955
|
}
|
|
1947
1956
|
/**
|
|
1948
1957
|
* Markdown Formatter.
|
package/dist/index.d.ts
CHANGED
|
@@ -364,6 +364,8 @@ interface MarkdownFormatterOptions {
|
|
|
364
364
|
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
365
365
|
/** Render a badge line under a scenario heading (e.g. a what's-changed marker). Undefined to skip. */
|
|
366
366
|
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
367
|
+
/** Render a business-context link line under a scenario heading. Undefined to skip. */
|
|
368
|
+
scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
|
|
367
369
|
}
|
|
368
370
|
|
|
369
371
|
/** Astro/Starlight formatter options */
|
|
@@ -493,6 +495,7 @@ interface ResolvedFormatterOptions {
|
|
|
493
495
|
customRenderers?: MarkdownRenderers;
|
|
494
496
|
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
495
497
|
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
498
|
+
scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
|
|
496
499
|
};
|
|
497
500
|
};
|
|
498
501
|
assetMode: "none" | "copy";
|
|
@@ -1943,6 +1946,12 @@ interface MarkdownOptions {
|
|
|
1943
1946
|
* line, or undefined to skip. Off by default — only the living-docs site opts in.
|
|
1944
1947
|
*/
|
|
1945
1948
|
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
1949
|
+
/**
|
|
1950
|
+
* Render a link line under a scenario heading pointing at hand-written context
|
|
1951
|
+
* (the scenario's note page). Return the markdown line, or undefined to skip.
|
|
1952
|
+
* Off by default — only the living-docs site opts in.
|
|
1953
|
+
*/
|
|
1954
|
+
scenarioNoteLink?: (tc: TestCaseResult) => string | undefined;
|
|
1946
1955
|
}
|
|
1947
1956
|
/**
|
|
1948
1957
|
* Markdown Formatter.
|
package/dist/index.js
CHANGED
|
@@ -15126,7 +15126,8 @@ var MarkdownFormatter = class {
|
|
|
15126
15126
|
includeSourceLinks: options.includeSourceLinks ?? true,
|
|
15127
15127
|
customRenderers: options.customRenderers,
|
|
15128
15128
|
scenarioAnchor: options.scenarioAnchor,
|
|
15129
|
-
scenarioBadge: options.scenarioBadge
|
|
15129
|
+
scenarioBadge: options.scenarioBadge,
|
|
15130
|
+
scenarioNoteLink: options.scenarioNoteLink
|
|
15130
15131
|
};
|
|
15131
15132
|
}
|
|
15132
15133
|
/**
|
|
@@ -15337,6 +15338,10 @@ var MarkdownFormatter = class {
|
|
|
15337
15338
|
if (badge) {
|
|
15338
15339
|
lines.push(badge);
|
|
15339
15340
|
}
|
|
15341
|
+
const noteLink = this.options.scenarioNoteLink?.(tc);
|
|
15342
|
+
if (noteLink) {
|
|
15343
|
+
lines.push(noteLink);
|
|
15344
|
+
}
|
|
15340
15345
|
if (this.options.includeSourceLinks && this.options.permalinkBaseUrl && tc.sourceFile !== "unknown") {
|
|
15341
15346
|
const permalink = this.buildPermalink(tc);
|
|
15342
15347
|
lines.push(`Source: [${tc.sourceFile}](${permalink})`);
|
|
@@ -21879,7 +21884,8 @@ var ReportGenerator = class {
|
|
|
21879
21884
|
traceUrlTemplate: options.astro?.markdown?.traceUrlTemplate,
|
|
21880
21885
|
customRenderers: options.astro?.markdown?.customRenderers,
|
|
21881
21886
|
scenarioAnchor: options.astro?.markdown?.scenarioAnchor,
|
|
21882
|
-
scenarioBadge: options.astro?.markdown?.scenarioBadge
|
|
21887
|
+
scenarioBadge: options.astro?.markdown?.scenarioBadge,
|
|
21888
|
+
scenarioNoteLink: options.astro?.markdown?.scenarioNoteLink
|
|
21883
21889
|
}
|
|
21884
21890
|
},
|
|
21885
21891
|
assetMode: options.assetMode ?? "none",
|