@vitest-agent/sdk 6.0.0 → 6.1.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/index.d.ts +122 -0
- package/index.js +2 -2
- package/package.json +1 -1
- package/schemas/5.0/run.json +29 -0
- package/schemas/Coverage.js +20 -2
- package/schemas/RenderState.js +3 -2
- package/schemas/RunEvent.js +3 -2
- package/version.js +1 -1
package/index.d.ts
CHANGED
|
@@ -28,6 +28,35 @@ export declare const FileCoverageReport: Schema.Struct<{
|
|
|
28
28
|
}>;
|
|
29
29
|
/** @public */
|
|
30
30
|
export type FileCoverageReport = typeof FileCoverageReport.Type;
|
|
31
|
+
/**
|
|
32
|
+
* A threshold glob whose AGGREGATE coverage (summed covered/total across
|
|
33
|
+
* every file the glob matches, the same way Vitest evaluates a glob
|
|
34
|
+
* threshold) is below at least one of the glob's metric numbers.
|
|
35
|
+
*
|
|
36
|
+
* This is independent of the per-file lists: with an object `perFile` every
|
|
37
|
+
* matched file can pass while the glob as a whole still fails.
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export declare const GlobShortfall: Schema.Struct<{
|
|
41
|
+
/** The threshold glob pattern as configured. */
|
|
42
|
+
readonly pattern: Schema.String;
|
|
43
|
+
/** Aggregate coverage percentages over the files the glob matches. */
|
|
44
|
+
readonly summary: Schema.Struct<{
|
|
45
|
+
readonly statements: Schema.Number;
|
|
46
|
+
readonly branches: Schema.Number;
|
|
47
|
+
readonly functions: Schema.Number;
|
|
48
|
+
readonly lines: Schema.Number;
|
|
49
|
+
}>;
|
|
50
|
+
/** The glob's own metric numbers that were set (`perFile` excluded). */
|
|
51
|
+
readonly thresholds: Schema.Struct<{
|
|
52
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
53
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
54
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
55
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
56
|
+
}>;
|
|
57
|
+
}>;
|
|
58
|
+
/** @public */
|
|
59
|
+
export type GlobShortfall = typeof GlobShortfall.Type;
|
|
31
60
|
/**
|
|
32
61
|
* Complete coverage report attached to an AgentReport.
|
|
33
62
|
* @public
|
|
@@ -124,6 +153,24 @@ export declare const CoverageReport: Schema.Struct<{
|
|
|
124
153
|
readonly uncoveredLines: Schema.String;
|
|
125
154
|
}>>>;
|
|
126
155
|
readonly belowTargetFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
156
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
157
|
+
/** The threshold glob pattern as configured. */
|
|
158
|
+
readonly pattern: Schema.String;
|
|
159
|
+
/** Aggregate coverage percentages over the files the glob matches. */
|
|
160
|
+
readonly summary: Schema.Struct<{
|
|
161
|
+
readonly statements: Schema.Number;
|
|
162
|
+
readonly branches: Schema.Number;
|
|
163
|
+
readonly functions: Schema.Number;
|
|
164
|
+
readonly lines: Schema.Number;
|
|
165
|
+
}>;
|
|
166
|
+
/** The glob's own metric numbers that were set (`perFile` excluded). */
|
|
167
|
+
readonly thresholds: Schema.Struct<{
|
|
168
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
169
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
170
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
171
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
172
|
+
}>;
|
|
173
|
+
}>>>;
|
|
127
174
|
}>;
|
|
128
175
|
/** @public */
|
|
129
176
|
export type CoverageReport = typeof CoverageReport.Type;
|
|
@@ -249,6 +296,21 @@ export declare const CoverageRenderState: Schema.Struct<{
|
|
|
249
296
|
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
250
297
|
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
251
298
|
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
299
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
300
|
+
readonly pattern: Schema.String;
|
|
301
|
+
readonly summary: Schema.Struct<{
|
|
302
|
+
readonly statements: Schema.Number;
|
|
303
|
+
readonly branches: Schema.Number;
|
|
304
|
+
readonly functions: Schema.Number;
|
|
305
|
+
readonly lines: Schema.Number;
|
|
306
|
+
}>;
|
|
307
|
+
readonly thresholds: Schema.Struct<{
|
|
308
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
309
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
310
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
311
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
312
|
+
}>;
|
|
313
|
+
}>>>;
|
|
252
314
|
}>;
|
|
253
315
|
/** @public */
|
|
254
316
|
export type CoverageRenderState = typeof CoverageRenderState.Type;
|
|
@@ -370,6 +432,21 @@ export declare const RenderState: Schema.Struct<{
|
|
|
370
432
|
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
371
433
|
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
372
434
|
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
435
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
436
|
+
readonly pattern: Schema.String;
|
|
437
|
+
readonly summary: Schema.Struct<{
|
|
438
|
+
readonly statements: Schema.Number;
|
|
439
|
+
readonly branches: Schema.Number;
|
|
440
|
+
readonly functions: Schema.Number;
|
|
441
|
+
readonly lines: Schema.Number;
|
|
442
|
+
}>;
|
|
443
|
+
readonly thresholds: Schema.Struct<{
|
|
444
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
445
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
446
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
447
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
448
|
+
}>;
|
|
449
|
+
}>>>;
|
|
373
450
|
}>>;
|
|
374
451
|
readonly trend: Schema.NullOr<Schema.Struct<{
|
|
375
452
|
readonly direction: Schema.Literals<readonly ["improving", "regressing", "stable"]>;
|
|
@@ -817,6 +894,21 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
817
894
|
readonly uncoveredLines: Schema.String;
|
|
818
895
|
}>>>;
|
|
819
896
|
readonly belowTargetFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
897
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
898
|
+
readonly pattern: Schema.String;
|
|
899
|
+
readonly summary: Schema.Struct<{
|
|
900
|
+
readonly statements: Schema.Number;
|
|
901
|
+
readonly branches: Schema.Number;
|
|
902
|
+
readonly functions: Schema.Number;
|
|
903
|
+
readonly lines: Schema.Number;
|
|
904
|
+
}>;
|
|
905
|
+
readonly thresholds: Schema.Struct<{
|
|
906
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
907
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
908
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
909
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
910
|
+
}>;
|
|
911
|
+
}>>>;
|
|
820
912
|
}>>;
|
|
821
913
|
readonly tagCounts: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
822
914
|
readonly passed: Schema.optional<Schema.Number>;
|
|
@@ -1173,6 +1265,21 @@ export declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunSt
|
|
|
1173
1265
|
readonly scoped: Schema.optional<Schema.Boolean>;
|
|
1174
1266
|
readonly scopedFiles: Schema.optional<Schema.Number>;
|
|
1175
1267
|
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
1268
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
1269
|
+
readonly pattern: Schema.String;
|
|
1270
|
+
readonly summary: Schema.Struct<{
|
|
1271
|
+
readonly statements: Schema.Number;
|
|
1272
|
+
readonly branches: Schema.Number;
|
|
1273
|
+
readonly functions: Schema.Number;
|
|
1274
|
+
readonly lines: Schema.Number;
|
|
1275
|
+
}>;
|
|
1276
|
+
readonly thresholds: Schema.Struct<{
|
|
1277
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
1278
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
1279
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
1280
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
1281
|
+
}>;
|
|
1282
|
+
}>>>;
|
|
1176
1283
|
}>, Schema.TaggedStruct<"ThresholdViolation", {
|
|
1177
1284
|
readonly metric: Schema.Literals<readonly ["lines", "branches", "functions", "statements"]>;
|
|
1178
1285
|
readonly expected: Schema.Number;
|
|
@@ -2789,6 +2896,21 @@ export declare const RunReportFile: Schema.Struct<{
|
|
|
2789
2896
|
readonly uncoveredLines: Schema.String;
|
|
2790
2897
|
}>>>;
|
|
2791
2898
|
readonly belowTargetFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
2899
|
+
readonly globShortfalls: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
2900
|
+
readonly pattern: Schema.String;
|
|
2901
|
+
readonly summary: Schema.Struct<{
|
|
2902
|
+
readonly statements: Schema.Number;
|
|
2903
|
+
readonly branches: Schema.Number;
|
|
2904
|
+
readonly functions: Schema.Number;
|
|
2905
|
+
readonly lines: Schema.Number;
|
|
2906
|
+
}>;
|
|
2907
|
+
readonly thresholds: Schema.Struct<{
|
|
2908
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
2909
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
2910
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
2911
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
2912
|
+
}>;
|
|
2913
|
+
}>>>;
|
|
2792
2914
|
}>>;
|
|
2793
2915
|
readonly tagCounts: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
2794
2916
|
readonly passed: Schema.optional<Schema.Number>;
|
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Agent, IdempotencyHit } from "./schemas/Agent.js";
|
|
|
10
10
|
import { AgentConsoleMode, CiConsoleMode, ConsoleMode, ConsoleOutputMode, DetailLevel, Environment, Executor, HumanConsoleMode, OutputFormat, PackageManager, ReportError, TestClassification, TestRunReason, TestState } from "./schemas/Common.js";
|
|
11
11
|
import { ConsoleLeakFile, ConsoleLeaks, ConsoleLeaksFromFailingTests } from "./schemas/ConsoleLeaks.js";
|
|
12
12
|
import { MetricThresholds, PatternMetricThresholds, PatternThresholds, PerFileThresholds, ResolvedThresholds } from "./schemas/Thresholds.js";
|
|
13
|
-
import { CoverageReport, CoverageTotals, FileCoverageReport } from "./schemas/Coverage.js";
|
|
13
|
+
import { CoverageReport, CoverageTotals, FileCoverageReport, GlobShortfall } from "./schemas/Coverage.js";
|
|
14
14
|
import { AgentReport, ModuleReport, ReportSummary, TagCountEntry, TestReport } from "./schemas/AgentReport.js";
|
|
15
15
|
import { CoverageBaselines } from "./schemas/Baselines.js";
|
|
16
16
|
import { CacheManifest, CacheManifestEntry } from "./schemas/CacheManifest.js";
|
|
@@ -62,4 +62,4 @@ import { validateCoverageTargetsShape } from "./utils/validate-coverage-targets-
|
|
|
62
62
|
import { requiredArtifactForTransition, transitionEnforcesBehaviorMatch, validatePhaseTransition } from "./utils/validate-phase-transition.js";
|
|
63
63
|
import { CURRENT_SDK_VERSION } from "./version.js";
|
|
64
64
|
|
|
65
|
-
export { ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, BATS_FILE_GLOB_SUFFIX, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, ChannelEvent, ChatId, CiConsoleMode, ConsoleLeakFile, ConsoleLeaks, ConsoleLeaksFromFailingTests, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, CoverageGap, CoverageLevel, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTotals, DataStoreError, DetailLevel, DiscoveryError, Environment, Executor, FailureRecord, FileCoverageReport, FileEditPayload, GitCommandError, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryRecord, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HumanConsoleMode, HypothesisPayload, IdempotencyHit, IllegalStatusTransitionError, MetricThresholds, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NotePayload, OutputFormat, PackageManager, PathResolutionError, PatternMetricThresholds, PatternThresholds, PerFileThresholds, PhaseTransitionEvent, ProbeMissError, ProjectIdentityNotResolvableError, ProjectKey, RUN_REPORT_FILE_SCHEMA_URL, RegistrationConflictError, RenderState, RenderTotals, ReportError, ReportOption, ReportSettings, ReportSummary, ResolvedThresholds, RunEvent, RunReportFile, SRC_DIR, SessionCompleteEvent, SessionNotFoundError, SessionOutcome, SidecarTimeoutError, SuggestedActionRecord, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TddTaskAlreadyEndedError, TddTaskId, TddTaskNotFoundError, TestAnnotation, TestArtifact, TestArtifactLocation, TestAttachment, TestClassification, TestHistory, TestRecord, TestReport, TestRun, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TurnPayload, UserPromptPayload, VitestAgentConfig, ansi, basenamePosix, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeTrend, countSuiteFailures, detectNonDefaultDiscoverStrategy, detectPackageManager, detectVitestScripts, determineTier, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleMarkdown, formatFatalError, formatGfm, formatScopedCoverageNote, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, initialRenderState, isTestFileName, isTimeoutError, isVitestInvocation, joinPosix, normalizeWorkspaceKey, osc8, probeHostMetadataFromEnv, relativePath, relativePosix, requiredArtifactForTransition, resolveCoverageInput, rewriteBashCommand, safeFilename, stripAnsi, toPosix, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
|
|
65
|
+
export { ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, BATS_FILE_GLOB_SUFFIX, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, ChannelEvent, ChatId, CiConsoleMode, ConsoleLeakFile, ConsoleLeaks, ConsoleLeaksFromFailingTests, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, CoverageGap, CoverageLevel, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTotals, DataStoreError, DetailLevel, DiscoveryError, Environment, Executor, FailureRecord, FileCoverageReport, FileEditPayload, GitCommandError, GlobShortfall, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryRecord, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HumanConsoleMode, HypothesisPayload, IdempotencyHit, IllegalStatusTransitionError, MetricThresholds, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NotePayload, OutputFormat, PackageManager, PathResolutionError, PatternMetricThresholds, PatternThresholds, PerFileThresholds, PhaseTransitionEvent, ProbeMissError, ProjectIdentityNotResolvableError, ProjectKey, RUN_REPORT_FILE_SCHEMA_URL, RegistrationConflictError, RenderState, RenderTotals, ReportError, ReportOption, ReportSettings, ReportSummary, ResolvedThresholds, RunEvent, RunReportFile, SRC_DIR, SessionCompleteEvent, SessionNotFoundError, SessionOutcome, SidecarTimeoutError, SuggestedActionRecord, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TddTaskAlreadyEndedError, TddTaskId, TddTaskNotFoundError, TestAnnotation, TestArtifact, TestArtifactLocation, TestAttachment, TestClassification, TestHistory, TestRecord, TestReport, TestRun, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TurnPayload, UserPromptPayload, VitestAgentConfig, ansi, basenamePosix, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeTrend, countSuiteFailures, detectNonDefaultDiscoverStrategy, detectPackageManager, detectVitestScripts, determineTier, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleMarkdown, formatFatalError, formatGfm, formatScopedCoverageNote, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, initialRenderState, isTestFileName, isTimeoutError, isVitestInvocation, joinPosix, normalizeWorkspaceKey, osc8, probeHostMetadataFromEnv, relativePath, relativePosix, requiredArtifactForTransition, resolveCoverageInput, rewriteBashCommand, safeFilename, stripAnsi, toPosix, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Platform-free core for the vitest-agent package family: Effect Schema definitions, reporter and dispatcher contracts, errors, and pure utilities.",
|
|
6
6
|
"keywords": [
|
package/schemas/5.0/run.json
CHANGED
|
@@ -526,6 +526,22 @@
|
|
|
526
526
|
"required": ["file", "summary", "uncoveredLines"],
|
|
527
527
|
"additionalProperties": true
|
|
528
528
|
},
|
|
529
|
+
"GlobShortfall": {
|
|
530
|
+
"type": "object",
|
|
531
|
+
"properties": {
|
|
532
|
+
"pattern": {
|
|
533
|
+
"type": "string"
|
|
534
|
+
},
|
|
535
|
+
"summary": {
|
|
536
|
+
"$ref": "#/$defs/CoverageTotals"
|
|
537
|
+
},
|
|
538
|
+
"thresholds": {
|
|
539
|
+
"$ref": "#/$defs/MetricThresholds"
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
"required": ["pattern", "summary", "thresholds"],
|
|
543
|
+
"additionalProperties": true
|
|
544
|
+
},
|
|
529
545
|
"CoverageReport": {
|
|
530
546
|
"type": "object",
|
|
531
547
|
"properties": {
|
|
@@ -665,6 +681,19 @@
|
|
|
665
681
|
"type": "null"
|
|
666
682
|
}
|
|
667
683
|
]
|
|
684
|
+
},
|
|
685
|
+
"globShortfalls": {
|
|
686
|
+
"anyOf": [
|
|
687
|
+
{
|
|
688
|
+
"type": "array",
|
|
689
|
+
"items": {
|
|
690
|
+
"$ref": "#/$defs/GlobShortfall"
|
|
691
|
+
}
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
"type": "null"
|
|
695
|
+
}
|
|
696
|
+
]
|
|
668
697
|
}
|
|
669
698
|
},
|
|
670
699
|
"required": ["totals", "thresholds", "lowCoverage", "lowCoverageFiles"],
|
package/schemas/Coverage.js
CHANGED
|
@@ -22,6 +22,23 @@ const FileCoverageReport = Schema.Struct({
|
|
|
22
22
|
uncoveredLines: Schema.String
|
|
23
23
|
}).annotate({ identifier: "FileCoverageReport" });
|
|
24
24
|
/**
|
|
25
|
+
* A threshold glob whose AGGREGATE coverage (summed covered/total across
|
|
26
|
+
* every file the glob matches, the same way Vitest evaluates a glob
|
|
27
|
+
* threshold) is below at least one of the glob's metric numbers.
|
|
28
|
+
*
|
|
29
|
+
* This is independent of the per-file lists: with an object `perFile` every
|
|
30
|
+
* matched file can pass while the glob as a whole still fails.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
const GlobShortfall = Schema.Struct({
|
|
34
|
+
/** The threshold glob pattern as configured. */
|
|
35
|
+
pattern: Schema.String,
|
|
36
|
+
/** Aggregate coverage percentages over the files the glob matches. */
|
|
37
|
+
summary: CoverageTotals,
|
|
38
|
+
/** The glob's own metric numbers that were set (`perFile` excluded). */
|
|
39
|
+
thresholds: MetricThresholds
|
|
40
|
+
}).annotate({ identifier: "GlobShortfall" });
|
|
41
|
+
/**
|
|
25
42
|
* Complete coverage report attached to an AgentReport.
|
|
26
43
|
* @public
|
|
27
44
|
*/
|
|
@@ -45,8 +62,9 @@ const CoverageReport = Schema.Struct({
|
|
|
45
62
|
lowCoverage: Schema.Array(FileCoverageReport),
|
|
46
63
|
lowCoverageFiles: Schema.Array(Schema.String),
|
|
47
64
|
belowTarget: Schema.optional(Schema.Array(FileCoverageReport)),
|
|
48
|
-
belowTargetFiles: Schema.optional(Schema.Array(Schema.String))
|
|
65
|
+
belowTargetFiles: Schema.optional(Schema.Array(Schema.String)),
|
|
66
|
+
globShortfalls: Schema.optional(Schema.Array(GlobShortfall))
|
|
49
67
|
}).annotate({ identifier: "CoverageReport" });
|
|
50
68
|
|
|
51
69
|
//#endregion
|
|
52
|
-
export { CoverageReport, CoverageTotals, FileCoverageReport };
|
|
70
|
+
export { CoverageReport, CoverageTotals, FileCoverageReport, GlobShortfall };
|
package/schemas/RenderState.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReportError, TestClassification, TestState } from "./Common.js";
|
|
2
2
|
import { MetricThresholds } from "./Thresholds.js";
|
|
3
|
-
import { CoverageTotals } from "./Coverage.js";
|
|
3
|
+
import { CoverageTotals, GlobShortfall } from "./Coverage.js";
|
|
4
4
|
import { ActionSeverity, CoverageGap, CoverageMetric } from "./RunEvent.js";
|
|
5
5
|
import { Schema } from "effect";
|
|
6
6
|
|
|
@@ -79,7 +79,8 @@ const CoverageRenderState = Schema.Struct({
|
|
|
79
79
|
})),
|
|
80
80
|
scoped: Schema.optional(Schema.Boolean),
|
|
81
81
|
scopedFiles: Schema.optional(Schema.Number),
|
|
82
|
-
totalFiles: Schema.optional(Schema.Number)
|
|
82
|
+
totalFiles: Schema.optional(Schema.Number),
|
|
83
|
+
globShortfalls: Schema.optional(Schema.Array(GlobShortfall))
|
|
83
84
|
}).annotate({ identifier: "CoverageRenderState" });
|
|
84
85
|
/**
|
|
85
86
|
* A `SuggestedAction` event, denormalized into the queue the renderer reads.
|
package/schemas/RunEvent.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReportError, TestClassification, TestState } from "./Common.js";
|
|
2
2
|
import { MetricThresholds } from "./Thresholds.js";
|
|
3
|
-
import { CoverageTotals, FileCoverageReport } from "./Coverage.js";
|
|
3
|
+
import { CoverageTotals, FileCoverageReport, GlobShortfall } from "./Coverage.js";
|
|
4
4
|
import { TestArtifactLocation, TestAttachment } from "./TestArtifacts.js";
|
|
5
5
|
import { Schema } from "effect";
|
|
6
6
|
|
|
@@ -178,7 +178,8 @@ const RunEvent = Schema.Union([
|
|
|
178
178
|
gaps: Schema.Array(CoverageGap),
|
|
179
179
|
scoped: Schema.optional(Schema.Boolean),
|
|
180
180
|
scopedFiles: Schema.optional(Schema.Number),
|
|
181
|
-
totalFiles: Schema.optional(Schema.Number)
|
|
181
|
+
totalFiles: Schema.optional(Schema.Number),
|
|
182
|
+
globShortfalls: Schema.optional(Schema.Array(GlobShortfall))
|
|
182
183
|
}),
|
|
183
184
|
Schema.TaggedStruct("ThresholdViolation", {
|
|
184
185
|
metric: CoverageMetric,
|