executable-stories-formatters 1.12.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/README.md +10 -0
- package/dist/cli.js +12497 -11602
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +531 -114
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -2
- package/dist/index.d.ts +112 -2
- package/dist/index.js +525 -111
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/schemas/README.md +4 -0
- package/schemas/raw-run.schema.json +27 -0
- package/templates/astro-thin/executable-stories.config.mjs +11 -6
- package/templates/astro-thin/src/content/docs/index.mdx +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1812,6 +1812,82 @@ interface WatchHandle {
|
|
|
1812
1812
|
*/
|
|
1813
1813
|
declare function startWatch(options: WatchOptions, deps?: WatchDeps): WatchHandle;
|
|
1814
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
|
+
|
|
1815
1891
|
interface BehaviorDiffEntry {
|
|
1816
1892
|
id: string;
|
|
1817
1893
|
title: string;
|
|
@@ -2888,6 +2964,23 @@ interface GenerateDeps {
|
|
|
2888
2964
|
logger: Logger;
|
|
2889
2965
|
/** File writer function */
|
|
2890
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;
|
|
2891
2984
|
}
|
|
2892
2985
|
/** Result of generate function: Map of format to array of file paths */
|
|
2893
2986
|
type GenerateResult = Map<OutputFormat, string[]>;
|
|
@@ -2913,7 +3006,24 @@ declare function normalizeFormats(formats: ReadonlyArray<FormatInput>): OutputFo
|
|
|
2913
3006
|
declare class ReportGenerator {
|
|
2914
3007
|
private options;
|
|
2915
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?;
|
|
2916
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;
|
|
2917
3027
|
/**
|
|
2918
3028
|
* Resolve options with defaults.
|
|
2919
3029
|
*/
|
|
@@ -2924,7 +3034,7 @@ declare class ReportGenerator {
|
|
|
2924
3034
|
* @param run - Canonical TestRunResult (use canonicalizeRun to create from RawRun)
|
|
2925
3035
|
* @returns Map of output format to generated file paths
|
|
2926
3036
|
*/
|
|
2927
|
-
generate(run: TestRunResult): Promise<GenerateResult>;
|
|
3037
|
+
generate(run: TestRunResult, options?: GenerateOptions): Promise<GenerateResult>;
|
|
2928
3038
|
/**
|
|
2929
3039
|
* Whether any output is colocated — the global mode, or any per-rule mode.
|
|
2930
3040
|
* A colocated rule under a global aggregated mode still writes per-file
|
|
@@ -3387,4 +3497,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
|
|
|
3387
3497
|
*/
|
|
3388
3498
|
declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
|
|
3389
3499
|
|
|
3390
|
-
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -1812,6 +1812,82 @@ interface WatchHandle {
|
|
|
1812
1812
|
*/
|
|
1813
1813
|
declare function startWatch(options: WatchOptions, deps?: WatchDeps): WatchHandle;
|
|
1814
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
|
+
|
|
1815
1891
|
interface BehaviorDiffEntry {
|
|
1816
1892
|
id: string;
|
|
1817
1893
|
title: string;
|
|
@@ -2888,6 +2964,23 @@ interface GenerateDeps {
|
|
|
2888
2964
|
logger: Logger;
|
|
2889
2965
|
/** File writer function */
|
|
2890
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;
|
|
2891
2984
|
}
|
|
2892
2985
|
/** Result of generate function: Map of format to array of file paths */
|
|
2893
2986
|
type GenerateResult = Map<OutputFormat, string[]>;
|
|
@@ -2913,7 +3006,24 @@ declare function normalizeFormats(formats: ReadonlyArray<FormatInput>): OutputFo
|
|
|
2913
3006
|
declare class ReportGenerator {
|
|
2914
3007
|
private options;
|
|
2915
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?;
|
|
2916
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;
|
|
2917
3027
|
/**
|
|
2918
3028
|
* Resolve options with defaults.
|
|
2919
3029
|
*/
|
|
@@ -2924,7 +3034,7 @@ declare class ReportGenerator {
|
|
|
2924
3034
|
* @param run - Canonical TestRunResult (use canonicalizeRun to create from RawRun)
|
|
2925
3035
|
* @returns Map of output format to generated file paths
|
|
2926
3036
|
*/
|
|
2927
|
-
generate(run: TestRunResult): Promise<GenerateResult>;
|
|
3037
|
+
generate(run: TestRunResult, options?: GenerateOptions): Promise<GenerateResult>;
|
|
2928
3038
|
/**
|
|
2929
3039
|
* Whether any output is colocated — the global mode, or any per-rule mode.
|
|
2930
3040
|
* A colocated rule under a global aggregated mode still writes per-file
|
|
@@ -3387,4 +3497,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
|
|
|
3387
3497
|
*/
|
|
3388
3498
|
declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
|
|
3389
3499
|
|
|
3390
|
-
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 };
|