@vitest-agent/sdk 2.5.1 → 3.0.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 +598 -14
- package/index.js +11 -7
- package/layers/DataReaderLive.js +90 -0
- package/layers/DataStoreLive.js +48 -2
- package/migrations/0002_test_artifacts.js +30 -0
- package/migrations/index.js +26 -0
- package/package.json +7 -6
- package/schemas/CoverageTargets.js +9 -4
- package/schemas/Options.js +20 -4
- package/schemas/RunEvent.js +8 -2
- package/schemas/RunReportFile.js +51 -0
- package/schemas/TestArtifacts.js +74 -0
- package/schemas/Thresholds.js +23 -3
- package/schemas/run-report-file-1.0.0.json +963 -0
- package/services/DataStore.js +8 -1
- package/testing/layers.js +2 -2
- package/testing.d.ts +165 -2
- package/testing.js +5 -4
- package/utils/ensure-migrated.js +2 -2
- package/utils/validate-coverage-targets-shape.js +12 -4
package/index.d.ts
CHANGED
|
@@ -56,6 +56,12 @@ export declare const CoverageReport: Schema.Struct<{
|
|
|
56
56
|
readonly functions: Schema.optional<Schema.Number>;
|
|
57
57
|
readonly branches: Schema.optional<Schema.Number>;
|
|
58
58
|
readonly statements: Schema.optional<Schema.Number>;
|
|
59
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
60
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
61
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
62
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
63
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
64
|
+
}>]>>;
|
|
59
65
|
}>]>>, never>;
|
|
60
66
|
}>;
|
|
61
67
|
readonly targets: Schema.optional<Schema.Struct<{
|
|
@@ -70,6 +76,12 @@ export declare const CoverageReport: Schema.Struct<{
|
|
|
70
76
|
readonly functions: Schema.optional<Schema.Number>;
|
|
71
77
|
readonly branches: Schema.optional<Schema.Number>;
|
|
72
78
|
readonly statements: Schema.optional<Schema.Number>;
|
|
79
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
80
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
81
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
82
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
83
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
84
|
+
}>]>>;
|
|
73
85
|
}>]>>, never>;
|
|
74
86
|
}>>;
|
|
75
87
|
readonly baselines: Schema.optional<Schema.Struct<{
|
|
@@ -84,6 +96,12 @@ export declare const CoverageReport: Schema.Struct<{
|
|
|
84
96
|
readonly functions: Schema.optional<Schema.Number>;
|
|
85
97
|
readonly branches: Schema.optional<Schema.Number>;
|
|
86
98
|
readonly statements: Schema.optional<Schema.Number>;
|
|
99
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
100
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
101
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
102
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
103
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
104
|
+
}>]>>;
|
|
87
105
|
}>]>>, never>;
|
|
88
106
|
}>>;
|
|
89
107
|
readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
@@ -706,6 +724,12 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
706
724
|
readonly functions: Schema.optional<Schema.Number>;
|
|
707
725
|
readonly branches: Schema.optional<Schema.Number>;
|
|
708
726
|
readonly statements: Schema.optional<Schema.Number>;
|
|
727
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
728
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
729
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
730
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
731
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
732
|
+
}>]>>;
|
|
709
733
|
}>]>>, never>;
|
|
710
734
|
}>;
|
|
711
735
|
readonly targets: Schema.optional<Schema.Struct<{
|
|
@@ -720,6 +744,12 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
720
744
|
readonly functions: Schema.optional<Schema.Number>;
|
|
721
745
|
readonly branches: Schema.optional<Schema.Number>;
|
|
722
746
|
readonly statements: Schema.optional<Schema.Number>;
|
|
747
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
748
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
749
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
750
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
751
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
752
|
+
}>]>>;
|
|
723
753
|
}>]>>, never>;
|
|
724
754
|
}>>;
|
|
725
755
|
readonly baselines: Schema.optional<Schema.Struct<{
|
|
@@ -734,6 +764,12 @@ export declare const AgentReport: Schema.Struct<{
|
|
|
734
764
|
readonly functions: Schema.optional<Schema.Number>;
|
|
735
765
|
readonly branches: Schema.optional<Schema.Number>;
|
|
736
766
|
readonly statements: Schema.optional<Schema.Number>;
|
|
767
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
768
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
769
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
770
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
771
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
772
|
+
}>]>>;
|
|
737
773
|
}>]>>, never>;
|
|
738
774
|
}>>;
|
|
739
775
|
readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
@@ -910,12 +946,29 @@ export declare const ReportError: Schema.Struct<{
|
|
|
910
946
|
export type ReportError = typeof ReportError.Type;
|
|
911
947
|
//#endregion
|
|
912
948
|
//#region src/formatters/types.d.ts
|
|
913
|
-
/**
|
|
914
|
-
|
|
949
|
+
/**
|
|
950
|
+
* One unit of rendered reporter output, tagged by where it goes.
|
|
951
|
+
*
|
|
952
|
+
* `stdout` writes to the process stdout stream, `github-summary`
|
|
953
|
+
* appends to the GitHub Actions step-summary file, and `file` is
|
|
954
|
+
* reserved for reporters that embed their own destination path.
|
|
955
|
+
*
|
|
956
|
+
* `report` writes `filename` into `.vitest/<scope>/` through Vitest 5's
|
|
957
|
+
* `createReport`. The plugin drops these when reporting is disabled,
|
|
958
|
+
* exactly as it drops `github-summary` outside GitHub Actions.
|
|
959
|
+
*
|
|
960
|
+
* @public
|
|
961
|
+
*/
|
|
962
|
+
export type RenderedOutput = {
|
|
915
963
|
readonly target: "stdout" | "file" | "github-summary";
|
|
916
964
|
readonly content: string;
|
|
917
965
|
readonly contentType: string;
|
|
918
|
-
}
|
|
966
|
+
} | {
|
|
967
|
+
readonly target: "report";
|
|
968
|
+
readonly filename: string;
|
|
969
|
+
readonly content: string;
|
|
970
|
+
readonly contentType: string;
|
|
971
|
+
};
|
|
919
972
|
/** @public */
|
|
920
973
|
export interface FormatterContext {
|
|
921
974
|
readonly detail: DetailLevel;
|
|
@@ -1087,11 +1140,36 @@ export declare const RunEvent: Schema.Union<readonly [Schema.TaggedStruct<"RunSt
|
|
|
1087
1140
|
readonly testName: Schema.String;
|
|
1088
1141
|
readonly suitePath: Schema.$Array<Schema.String>;
|
|
1089
1142
|
readonly annotation: Schema.String;
|
|
1143
|
+
readonly annotationType: Schema.String;
|
|
1144
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
1145
|
+
readonly file: Schema.String;
|
|
1146
|
+
readonly line: Schema.Number;
|
|
1147
|
+
readonly column: Schema.Number;
|
|
1148
|
+
}>>;
|
|
1149
|
+
readonly attachments: Schema.$Array<Schema.Struct<{
|
|
1150
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
1151
|
+
readonly path: Schema.optional<Schema.String>;
|
|
1152
|
+
readonly body: Schema.optional<Schema.String>;
|
|
1153
|
+
readonly bodyEncoding: Schema.optional<Schema.Literals<readonly ["base64", "utf-8"]>>;
|
|
1154
|
+
readonly byteSize: Schema.Number;
|
|
1155
|
+
}>>;
|
|
1090
1156
|
}>, Schema.TaggedStruct<"TestArtifactRecorded", {
|
|
1091
1157
|
readonly modulePath: Schema.String;
|
|
1092
1158
|
readonly testName: Schema.String;
|
|
1093
1159
|
readonly suitePath: Schema.$Array<Schema.String>;
|
|
1094
1160
|
readonly artifact: Schema.String;
|
|
1161
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
1162
|
+
readonly file: Schema.String;
|
|
1163
|
+
readonly line: Schema.Number;
|
|
1164
|
+
readonly column: Schema.Number;
|
|
1165
|
+
}>>;
|
|
1166
|
+
readonly attachments: Schema.$Array<Schema.Struct<{
|
|
1167
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
1168
|
+
readonly path: Schema.optional<Schema.String>;
|
|
1169
|
+
readonly body: Schema.optional<Schema.String>;
|
|
1170
|
+
readonly bodyEncoding: Schema.optional<Schema.Literals<readonly ["base64", "utf-8"]>>;
|
|
1171
|
+
readonly byteSize: Schema.Number;
|
|
1172
|
+
}>>;
|
|
1095
1173
|
}>, Schema.TaggedStruct<"WatcherReady", {}>, Schema.TaggedStruct<"WatcherRerun", {
|
|
1096
1174
|
readonly triggerFiles: Schema.$Array<Schema.String>;
|
|
1097
1175
|
readonly reason: Schema.optional<Schema.String>;
|
|
@@ -1191,6 +1269,43 @@ export declare const MetricThresholds: Schema.Struct<{
|
|
|
1191
1269
|
}>;
|
|
1192
1270
|
/** @public */
|
|
1193
1271
|
export type MetricThresholds = typeof MetricThresholds.Type;
|
|
1272
|
+
/**
|
|
1273
|
+
* A `perFile` setting. Vitest 5 allows either a plain boolean or a
|
|
1274
|
+
* per-metric object that overrides the metric numbers used for the
|
|
1275
|
+
* per-file check.
|
|
1276
|
+
*
|
|
1277
|
+
* An object constrains exactly the metrics it names, so `{}` enforces
|
|
1278
|
+
* nothing at all. Write `true` to check every metric.
|
|
1279
|
+
* @public
|
|
1280
|
+
*/
|
|
1281
|
+
export declare const PerFileThresholds: Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1282
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
1283
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
1284
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
1285
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
1286
|
+
}>]>;
|
|
1287
|
+
/** @public */
|
|
1288
|
+
export type PerFileThresholds = typeof PerFileThresholds.Type;
|
|
1289
|
+
/**
|
|
1290
|
+
* The metric values carried by a glob-pattern entry. Under Vitest 5 a
|
|
1291
|
+
* glob entry no longer inherits the top-level `perFile`, so it carries
|
|
1292
|
+
* its own optional setting.
|
|
1293
|
+
* @public
|
|
1294
|
+
*/
|
|
1295
|
+
export declare const PatternMetricThresholds: Schema.Struct<{
|
|
1296
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
1297
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
1298
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
1299
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
1300
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1301
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
1302
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
1303
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
1304
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
1305
|
+
}>]>>;
|
|
1306
|
+
}>;
|
|
1307
|
+
/** @public */
|
|
1308
|
+
export type PatternMetricThresholds = typeof PatternMetricThresholds.Type;
|
|
1194
1309
|
/**
|
|
1195
1310
|
* A glob pattern paired with its metric thresholds.
|
|
1196
1311
|
* @public
|
|
@@ -1200,6 +1315,12 @@ export declare const PatternThresholds: Schema.Tuple<readonly [Schema.String, Sc
|
|
|
1200
1315
|
readonly functions: Schema.optional<Schema.Number>;
|
|
1201
1316
|
readonly branches: Schema.optional<Schema.Number>;
|
|
1202
1317
|
readonly statements: Schema.optional<Schema.Number>;
|
|
1318
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1319
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
1320
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
1321
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
1322
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
1323
|
+
}>]>>;
|
|
1203
1324
|
}>]>;
|
|
1204
1325
|
/** @public */
|
|
1205
1326
|
export type PatternThresholds = typeof PatternThresholds.Type;
|
|
@@ -1214,12 +1335,23 @@ export declare const ResolvedThresholds: Schema.Struct<{
|
|
|
1214
1335
|
readonly branches: Schema.optional<Schema.Number>;
|
|
1215
1336
|
readonly statements: Schema.optional<Schema.Number>;
|
|
1216
1337
|
}>;
|
|
1217
|
-
readonly perFile: Schema.withDecodingDefaultKey<Schema.Boolean,
|
|
1338
|
+
readonly perFile: Schema.withDecodingDefaultKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1339
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
1340
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
1341
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
1342
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
1343
|
+
}>]>, never>;
|
|
1218
1344
|
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
1219
1345
|
readonly lines: Schema.optional<Schema.Number>;
|
|
1220
1346
|
readonly functions: Schema.optional<Schema.Number>;
|
|
1221
1347
|
readonly branches: Schema.optional<Schema.Number>;
|
|
1222
1348
|
readonly statements: Schema.optional<Schema.Number>;
|
|
1349
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
1350
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
1351
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
1352
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
1353
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
1354
|
+
}>]>>;
|
|
1223
1355
|
}>]>>, never>;
|
|
1224
1356
|
}>;
|
|
1225
1357
|
/** @public */
|
|
@@ -1929,6 +2061,12 @@ export declare const CoverageBaselines: Schema.Struct<{
|
|
|
1929
2061
|
readonly functions: Schema.optional<Schema.Number>;
|
|
1930
2062
|
readonly branches: Schema.optional<Schema.Number>;
|
|
1931
2063
|
readonly statements: Schema.optional<Schema.Number>;
|
|
2064
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
2065
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
2066
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
2067
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
2068
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
2069
|
+
}>]>>;
|
|
1932
2070
|
}>]>>, never>;
|
|
1933
2071
|
}>;
|
|
1934
2072
|
/** @public */
|
|
@@ -2472,6 +2610,48 @@ export interface TestErrorInput {
|
|
|
2472
2610
|
readonly frames?: ReadonlyArray<StackFrameInput>;
|
|
2473
2611
|
readonly ordinal?: number;
|
|
2474
2612
|
}
|
|
2613
|
+
/**
|
|
2614
|
+
* Ceiling on an inline attachment body. Vitest has already copied file
|
|
2615
|
+
* attachments into `.vitest/attachments/`, so a large body is referenced
|
|
2616
|
+
* by `path` rather than duplicated into `data.db`.
|
|
2617
|
+
* @public
|
|
2618
|
+
*/
|
|
2619
|
+
export declare const INLINE_ATTACHMENT_BODY_CAP_BYTES: number;
|
|
2620
|
+
/** @public */
|
|
2621
|
+
export interface TestAttachmentInput {
|
|
2622
|
+
readonly contentType?: string;
|
|
2623
|
+
/** Post-resolution path under `.vitest/attachments/`, or an http(s) URL. */
|
|
2624
|
+
readonly path?: string;
|
|
2625
|
+
/** Inline body; persisted only when `byteSize` is under the 64 KiB cap. */
|
|
2626
|
+
readonly body?: string;
|
|
2627
|
+
/** How to read `body`. Vitest treats a string body as base64 unless `"utf-8"`. */
|
|
2628
|
+
readonly bodyEncoding?: "base64" | "utf-8";
|
|
2629
|
+
readonly byteSize: number;
|
|
2630
|
+
}
|
|
2631
|
+
/** @public */
|
|
2632
|
+
export interface TestAnnotationInput {
|
|
2633
|
+
readonly testCaseId: number;
|
|
2634
|
+
/** Arbitrary Vitest annotation type -- not an enum. */
|
|
2635
|
+
readonly type: string;
|
|
2636
|
+
readonly message: string;
|
|
2637
|
+
readonly locationFile?: string;
|
|
2638
|
+
readonly locationLine?: number;
|
|
2639
|
+
readonly locationColumn?: number;
|
|
2640
|
+
readonly attachments?: ReadonlyArray<TestAttachmentInput>;
|
|
2641
|
+
}
|
|
2642
|
+
/** @public */
|
|
2643
|
+
export interface TestArtifactInput {
|
|
2644
|
+
readonly testCaseId: number;
|
|
2645
|
+
/** `pkg:name`; `internal:` types are Vitest's own and are never written. */
|
|
2646
|
+
readonly type: string;
|
|
2647
|
+
readonly message?: string;
|
|
2648
|
+
/** JSON of the artifact's custom fields, minus attachments and location. */
|
|
2649
|
+
readonly data?: string;
|
|
2650
|
+
readonly locationFile?: string;
|
|
2651
|
+
readonly locationLine?: number;
|
|
2652
|
+
readonly locationColumn?: number;
|
|
2653
|
+
readonly attachments?: ReadonlyArray<TestAttachmentInput>;
|
|
2654
|
+
}
|
|
2475
2655
|
/** @public */
|
|
2476
2656
|
export interface FileCoverageInput {
|
|
2477
2657
|
readonly fileId: number;
|
|
@@ -2686,6 +2866,17 @@ declare const DataStore_base: Context.ServiceClass<DataStore, "vitest-agent/Data
|
|
|
2686
2866
|
readonly writeSuites: (moduleId: number, suites: ReadonlyArray<SuiteInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
|
|
2687
2867
|
readonly writeTestCases: (moduleId: number, tests: ReadonlyArray<TestCaseInput>) => Effect.Effect<ReadonlyArray<number>, DataStoreError>;
|
|
2688
2868
|
readonly writeErrors: (runId: number, errors: ReadonlyArray<TestErrorInput>) => Effect.Effect<void, DataStoreError>;
|
|
2869
|
+
/**
|
|
2870
|
+
* Persist `context.annotate` notes and their attachment descriptors.
|
|
2871
|
+
* `runId` is carried for log correlation only -- `test_annotations`
|
|
2872
|
+
* rows are reachable through `test_cases`.
|
|
2873
|
+
*/
|
|
2874
|
+
readonly writeAnnotations: (runId: number, annotations: ReadonlyArray<TestAnnotationInput>) => Effect.Effect<void, DataStoreError>;
|
|
2875
|
+
/**
|
|
2876
|
+
* Persist `recordArtifact` payloads and their attachment
|
|
2877
|
+
* descriptors. `runId` is carried for log correlation only.
|
|
2878
|
+
*/
|
|
2879
|
+
readonly writeArtifacts: (runId: number, artifacts: ReadonlyArray<TestArtifactInput>) => Effect.Effect<void, DataStoreError>;
|
|
2689
2880
|
readonly writeCoverage: (runId: number, coverage: ReadonlyArray<FileCoverageInput>) => Effect.Effect<void, DataStoreError>;
|
|
2690
2881
|
readonly writeHistory: (project: string, fullName: string, modulePath: string, runId: number, timestamp: string, state: string, duration: number | null, flaky: boolean, retryCount: number, errorMessage: string | null) => Effect.Effect<void, DataStoreError>;
|
|
2691
2882
|
readonly writeBaselines: (baselines: CoverageBaselines) => Effect.Effect<void, DataStoreError>;
|
|
@@ -3111,6 +3302,45 @@ export interface TagInventoryRow {
|
|
|
3111
3302
|
*/
|
|
3112
3303
|
readonly testCount: number;
|
|
3113
3304
|
}
|
|
3305
|
+
/** @public */
|
|
3306
|
+
export interface TestArtifactQueryOptions {
|
|
3307
|
+
/** Disambiguates a fullName that exists in more than one module. */
|
|
3308
|
+
readonly modulePath?: string;
|
|
3309
|
+
}
|
|
3310
|
+
/** @public */
|
|
3311
|
+
export interface PersistedAttachment {
|
|
3312
|
+
readonly contentType?: string;
|
|
3313
|
+
readonly path?: string;
|
|
3314
|
+
readonly body?: string;
|
|
3315
|
+
/** How to read `body`. Absent when nothing was stored inline. */
|
|
3316
|
+
readonly bodyEncoding?: "base64" | "utf-8";
|
|
3317
|
+
readonly byteSize: number | null;
|
|
3318
|
+
}
|
|
3319
|
+
/** @public */
|
|
3320
|
+
export interface TestAnnotationRow {
|
|
3321
|
+
readonly id: number;
|
|
3322
|
+
readonly type: string;
|
|
3323
|
+
readonly message: string;
|
|
3324
|
+
readonly location?: {
|
|
3325
|
+
readonly file: string;
|
|
3326
|
+
readonly line: number;
|
|
3327
|
+
readonly column: number;
|
|
3328
|
+
};
|
|
3329
|
+
readonly attachments: ReadonlyArray<PersistedAttachment>;
|
|
3330
|
+
}
|
|
3331
|
+
/** @public */
|
|
3332
|
+
export interface TestArtifactRow {
|
|
3333
|
+
readonly id: number;
|
|
3334
|
+
readonly type: string;
|
|
3335
|
+
readonly message: string | null;
|
|
3336
|
+
readonly data: string | null;
|
|
3337
|
+
readonly location?: {
|
|
3338
|
+
readonly file: string;
|
|
3339
|
+
readonly line: number;
|
|
3340
|
+
readonly column: number;
|
|
3341
|
+
};
|
|
3342
|
+
readonly attachments: ReadonlyArray<PersistedAttachment>;
|
|
3343
|
+
}
|
|
3114
3344
|
declare const DataReader_base: Context.ServiceClass<DataReader, "vitest-agent/DataReader", {
|
|
3115
3345
|
readonly getLatestRun: (project: string) => Effect.Effect<Option.Option<AgentReport>, DataStoreError>;
|
|
3116
3346
|
readonly getRunsByProject: () => Effect.Effect<ReadonlyArray<ProjectRunSummary>, DataStoreError>;
|
|
@@ -3123,6 +3353,10 @@ declare const DataReader_base: Context.ServiceClass<DataReader, "vitest-agent/Da
|
|
|
3123
3353
|
readonly getCoverage: (project: string) => Effect.Effect<Option.Option<CoverageReport>, DataStoreError>;
|
|
3124
3354
|
readonly getTestsForFile: (filePath: string) => Effect.Effect<ReadonlyArray<string>, DataStoreError>;
|
|
3125
3355
|
readonly getErrors: (project: string, errorName?: string) => Effect.Effect<ReadonlyArray<TestError>, DataStoreError>;
|
|
3356
|
+
/** Annotations recorded for a test in the project's latest run. */
|
|
3357
|
+
readonly getAnnotationsForTest: (project: string, fullName: string, options?: TestArtifactQueryOptions) => Effect.Effect<ReadonlyArray<TestAnnotationRow>, DataStoreError>;
|
|
3358
|
+
/** Artifacts recorded for a test in the project's latest run. */
|
|
3359
|
+
readonly getArtifactsForTest: (project: string, fullName: string, options?: TestArtifactQueryOptions) => Effect.Effect<ReadonlyArray<TestArtifactRow>, DataStoreError>;
|
|
3126
3360
|
readonly getNotes: (scope?: string, project?: string, testFullName?: string) => Effect.Effect<ReadonlyArray<NoteRow>, DataStoreError>;
|
|
3127
3361
|
readonly getNoteById: (id: number) => Effect.Effect<Option.Option<NoteRow>, DataStoreError>;
|
|
3128
3362
|
readonly searchNotes: (query: string) => Effect.Effect<ReadonlyArray<NoteRow>, DataStoreError>;
|
|
@@ -3844,6 +4078,31 @@ export declare const formatWrapupEffect: (options: FormatWrapupOptions) => Effec
|
|
|
3844
4078
|
/** @internal */
|
|
3845
4079
|
declare const migration: Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>;
|
|
3846
4080
|
//#endregion
|
|
4081
|
+
//#region src/migrations/0002_test_artifacts.d.ts
|
|
4082
|
+
/** @internal */
|
|
4083
|
+
declare const migration$1: Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>;
|
|
4084
|
+
//#endregion
|
|
4085
|
+
//#region src/migrations/index.d.ts
|
|
4086
|
+
/**
|
|
4087
|
+
* Every migration that must run against a per-project `data.db`, keyed by
|
|
4088
|
+
* migration id in application order.
|
|
4089
|
+
*
|
|
4090
|
+
* This is the single source of truth for the project database's migration
|
|
4091
|
+
* set: `ensureMigrated`, the sdk testing layer, `ReporterLive`, `McpLive`,
|
|
4092
|
+
* `CliLive` and `SidecarLive` all pass it straight to
|
|
4093
|
+
* `SqliteMigrator.fromRecord`, so adding a migration file and registering it
|
|
4094
|
+
* here is enough to reach every process that opens a project database.
|
|
4095
|
+
*
|
|
4096
|
+
* The session-map and discovery-registry databases are separate schemas with
|
|
4097
|
+
* their own migrations and are deliberately not listed here.
|
|
4098
|
+
*
|
|
4099
|
+
* @public
|
|
4100
|
+
*/
|
|
4101
|
+
export declare const PROJECT_MIGRATIONS: {
|
|
4102
|
+
readonly "0001_initial": import("effect/Effect").Effect<void, import("effect/unstable/sql/SqlError").SqlError, import("effect/unstable/sql/SqlClient").SqlClient>;
|
|
4103
|
+
readonly "0002_test_artifacts": import("effect/Effect").Effect<void, import("effect/unstable/sql/SqlError").SqlError, import("effect/unstable/sql/SqlClient").SqlClient>;
|
|
4104
|
+
};
|
|
4105
|
+
//#endregion
|
|
3847
4106
|
//#region src/migrations/registry_0001_initial.d.ts
|
|
3848
4107
|
/**
|
|
3849
4108
|
* Migration for the global discovery registry SQLite at
|
|
@@ -3859,11 +4118,11 @@ declare const migration: Effect.Effect<void, import("effect/unstable/sql/SqlErro
|
|
|
3859
4118
|
* the `ON CONFLICT(project_key) DO UPDATE` upsert.
|
|
3860
4119
|
* @public
|
|
3861
4120
|
*/
|
|
3862
|
-
declare const migration$
|
|
4121
|
+
declare const migration$2: Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>;
|
|
3863
4122
|
//#endregion
|
|
3864
4123
|
//#region src/migrations/session_map_0001_initial.d.ts
|
|
3865
4124
|
/** @internal */
|
|
3866
|
-
declare const migration$
|
|
4125
|
+
declare const migration$3: Effect.Effect<void, import("effect/unstable/sql/SqlError").SqlError, SqlClient>;
|
|
3867
4126
|
//#endregion
|
|
3868
4127
|
//#region src/schemas/ChannelEvent.d.ts
|
|
3869
4128
|
/** @public */
|
|
@@ -4225,7 +4484,8 @@ export declare function validateCoverageConfig(thresholds: CoverageLevel, target
|
|
|
4225
4484
|
//#region src/schemas/CoverageTargets.d.ts
|
|
4226
4485
|
/**
|
|
4227
4486
|
* Per-metric leaf shape for coverageTargets entries. Allows optional
|
|
4228
|
-
* numeric targets per metric
|
|
4487
|
+
* numeric targets per metric, the `100: true` shortcut, and — mirroring
|
|
4488
|
+
* Vitest 5 — a per-glob `perFile` setting.
|
|
4229
4489
|
* @public
|
|
4230
4490
|
*/
|
|
4231
4491
|
export declare const CoverageTargetsMetrics: Schema.Struct<{
|
|
@@ -4234,6 +4494,12 @@ export declare const CoverageTargetsMetrics: Schema.Struct<{
|
|
|
4234
4494
|
readonly branches: Schema.optional<Schema.Number>;
|
|
4235
4495
|
readonly statements: Schema.optional<Schema.Number>;
|
|
4236
4496
|
readonly 100: Schema.optional<Schema.Literal<true>>;
|
|
4497
|
+
readonly perFile: Schema.optional<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
4498
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4499
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4500
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4501
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4502
|
+
}>]>>;
|
|
4237
4503
|
}>;
|
|
4238
4504
|
/** @public */
|
|
4239
4505
|
export type CoverageTargetsMetrics = typeof CoverageTargetsMetrics.Type;
|
|
@@ -4243,8 +4509,10 @@ export type CoverageTargetsMetrics = typeof CoverageTargetsMetrics.Type;
|
|
|
4243
4509
|
* Mirrors Vitest's coverage.thresholds shape — per-metric positive numbers,
|
|
4244
4510
|
* the `100: true` shortcut (only valid at key `"100"`), and glob-pattern
|
|
4245
4511
|
* entries with metric objects. Positive numbers only; negatives and zeros
|
|
4246
|
-
* are rejected. `perFile` is not allowed here —
|
|
4247
|
-
* `coverage.thresholds.perFile`.
|
|
4512
|
+
* are rejected. A top-level `perFile` is not allowed here — set it on
|
|
4513
|
+
* `coverage.thresholds.perFile`. A `perFile` inside a glob-pattern entry
|
|
4514
|
+
* IS allowed, mirroring Vitest 5, where a glob entry no longer inherits
|
|
4515
|
+
* the top-level setting.
|
|
4248
4516
|
*
|
|
4249
4517
|
* A decode-time refinement rejects `true` at any key other than `"100"`
|
|
4250
4518
|
* so `{ statements: true }` fails parse rather than silently flowing
|
|
@@ -4258,6 +4526,12 @@ export declare const CoverageTargets: Schema.$Record<Schema.String, Schema.Union
|
|
|
4258
4526
|
readonly branches: Schema.optional<Schema.Number>;
|
|
4259
4527
|
readonly statements: Schema.optional<Schema.Number>;
|
|
4260
4528
|
readonly 100: Schema.optional<Schema.Literal<true>>;
|
|
4529
|
+
readonly perFile: Schema.optional<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
4530
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4531
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4532
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4533
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4534
|
+
}>]>>;
|
|
4261
4535
|
}>]>>;
|
|
4262
4536
|
/** @public */
|
|
4263
4537
|
export type CoverageTargets = typeof CoverageTargets.Type;
|
|
@@ -4285,13 +4559,36 @@ export declare const ConsoleOutputs: Schema.Struct<{
|
|
|
4285
4559
|
}>;
|
|
4286
4560
|
/** @public */
|
|
4287
4561
|
export type ConsoleOutputs = typeof ConsoleOutputs.Type;
|
|
4562
|
+
/**
|
|
4563
|
+
* Report-file settings. An object overrides the scope directory name
|
|
4564
|
+
* used under `.vitest/`; the default scope is `vitest-agent`.
|
|
4565
|
+
*
|
|
4566
|
+
* @public
|
|
4567
|
+
*/
|
|
4568
|
+
export declare const ReportSettings: Schema.Struct<{
|
|
4569
|
+
readonly scope: Schema.optional<Schema.String>;
|
|
4570
|
+
}>;
|
|
4571
|
+
/** @public */
|
|
4572
|
+
export type ReportSettings = typeof ReportSettings.Type;
|
|
4573
|
+
/**
|
|
4574
|
+
* Report-file settings. `false` disables `.vitest/<scope>/` writes
|
|
4575
|
+
* entirely; an object overrides the scope directory name.
|
|
4576
|
+
*
|
|
4577
|
+
* Default: on for the `agent` and `ci` executors, off for `human`.
|
|
4578
|
+
* @public
|
|
4579
|
+
*/
|
|
4580
|
+
export declare const ReportOption: Schema.Union<readonly [Schema.Literal<false>, Schema.Struct<{
|
|
4581
|
+
readonly scope: Schema.optional<Schema.String>;
|
|
4582
|
+
}>]>;
|
|
4583
|
+
/** @public */
|
|
4584
|
+
export type ReportOption = typeof ReportOption.Type;
|
|
4288
4585
|
/**
|
|
4289
4586
|
* The 2.0 user-facing options for `AgentPlugin`.
|
|
4290
4587
|
*
|
|
4291
|
-
*
|
|
4588
|
+
* Six fields total. Two are function-typed (`reporter`, `onRunEvent`)
|
|
4292
4589
|
* and live on the `AgentPluginConstructorOptions` companion interface in
|
|
4293
4590
|
* `@vitest-agent/plugin` — Effect Schema cannot encode functions cleanly,
|
|
4294
|
-
* so the schema-decodable struct carries the
|
|
4591
|
+
* so the schema-decodable struct carries the four data-shaped fields.
|
|
4295
4592
|
* @public
|
|
4296
4593
|
*/
|
|
4297
4594
|
export declare const AgentPluginOptions: Schema.Struct<{
|
|
@@ -4306,10 +4603,19 @@ export declare const AgentPluginOptions: Schema.Struct<{
|
|
|
4306
4603
|
readonly branches: Schema.optional<Schema.Number>;
|
|
4307
4604
|
readonly statements: Schema.optional<Schema.Number>;
|
|
4308
4605
|
readonly 100: Schema.optional<Schema.Literal<true>>;
|
|
4606
|
+
readonly perFile: Schema.optional<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
4607
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4608
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4609
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4610
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4611
|
+
}>]>>;
|
|
4309
4612
|
}>]>>>;
|
|
4310
4613
|
readonly transport: Schema.optional<Schema.Union<readonly [Schema.Struct<{
|
|
4311
4614
|
readonly kind: Schema.Literal<"local">;
|
|
4312
4615
|
}>]>>;
|
|
4616
|
+
readonly report: Schema.optional<Schema.Union<readonly [Schema.Literal<false>, Schema.Struct<{
|
|
4617
|
+
readonly scope: Schema.optional<Schema.String>;
|
|
4618
|
+
}>]>>;
|
|
4313
4619
|
}>;
|
|
4314
4620
|
/** @public */
|
|
4315
4621
|
export type AgentPluginOptions = typeof AgentPluginOptions.Type;
|
|
@@ -4331,6 +4637,282 @@ export declare const AgentReporterOptions: Schema.Struct<{
|
|
|
4331
4637
|
/** @public */
|
|
4332
4638
|
export type AgentReporterOptions = typeof AgentReporterOptions.Type;
|
|
4333
4639
|
//#endregion
|
|
4640
|
+
//#region src/schemas/RunReportFile.d.ts
|
|
4641
|
+
/**
|
|
4642
|
+
* Canonical `$schema` URL for `RunReportFile` version 1.
|
|
4643
|
+
*
|
|
4644
|
+
* Written as the first key of `run.json` so an editor or a JSON Schema
|
|
4645
|
+
* validator can resolve the contract without knowing about vitest-agent.
|
|
4646
|
+
*
|
|
4647
|
+
* @public
|
|
4648
|
+
*/
|
|
4649
|
+
export declare const RUN_REPORT_FILE_SCHEMA_URL = "https://vitest-agent.dev/schemas/run-report-file-1.0.0.json";
|
|
4650
|
+
/**
|
|
4651
|
+
* Envelope for the `run.json` report file.
|
|
4652
|
+
*
|
|
4653
|
+
* @public
|
|
4654
|
+
*/
|
|
4655
|
+
export declare const RunReportFile: Schema.Struct<{
|
|
4656
|
+
readonly $schema: Schema.optionalKey<Schema.String>;
|
|
4657
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
4658
|
+
readonly generatedAt: Schema.String;
|
|
4659
|
+
readonly reports: Schema.$Array<Schema.Struct<{
|
|
4660
|
+
readonly timestamp: Schema.String;
|
|
4661
|
+
readonly project: Schema.optional<Schema.String>;
|
|
4662
|
+
readonly reason: Schema.Literals<readonly ["passed", "failed", "interrupted"]>;
|
|
4663
|
+
readonly summary: Schema.Struct<{
|
|
4664
|
+
readonly total: Schema.Number;
|
|
4665
|
+
readonly passed: Schema.Number;
|
|
4666
|
+
readonly failed: Schema.Number;
|
|
4667
|
+
readonly skipped: Schema.Number;
|
|
4668
|
+
readonly duration: Schema.Number;
|
|
4669
|
+
readonly modules: Schema.optional<Schema.Number>;
|
|
4670
|
+
}>;
|
|
4671
|
+
readonly failed: Schema.$Array<Schema.Struct<{
|
|
4672
|
+
readonly file: Schema.String;
|
|
4673
|
+
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
4674
|
+
readonly duration: Schema.optional<Schema.Number>;
|
|
4675
|
+
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
4676
|
+
readonly message: Schema.String;
|
|
4677
|
+
readonly stack: Schema.optional<Schema.String>;
|
|
4678
|
+
readonly diff: Schema.optional<Schema.String>;
|
|
4679
|
+
readonly expected: Schema.optional<Schema.String>;
|
|
4680
|
+
readonly received: Schema.optional<Schema.String>;
|
|
4681
|
+
}>>>;
|
|
4682
|
+
readonly tests: Schema.$Array<Schema.Struct<{
|
|
4683
|
+
readonly name: Schema.String;
|
|
4684
|
+
readonly fullName: Schema.String;
|
|
4685
|
+
readonly state: Schema.Literals<readonly ["passed", "failed", "skipped", "pending"]>;
|
|
4686
|
+
readonly duration: Schema.optional<Schema.Number>;
|
|
4687
|
+
readonly flaky: Schema.optional<Schema.Boolean>;
|
|
4688
|
+
readonly slow: Schema.optional<Schema.Boolean>;
|
|
4689
|
+
readonly errors: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
4690
|
+
readonly message: Schema.String;
|
|
4691
|
+
readonly stack: Schema.optional<Schema.String>;
|
|
4692
|
+
readonly diff: Schema.optional<Schema.String>;
|
|
4693
|
+
readonly expected: Schema.optional<Schema.String>;
|
|
4694
|
+
readonly received: Schema.optional<Schema.String>;
|
|
4695
|
+
}>>>;
|
|
4696
|
+
readonly classification: Schema.optional<Schema.Literals<readonly ["stable", "new-failure", "persistent", "flaky", "recovered"]>>;
|
|
4697
|
+
}>>;
|
|
4698
|
+
}>>;
|
|
4699
|
+
readonly unhandledErrors: Schema.$Array<Schema.Struct<{
|
|
4700
|
+
readonly message: Schema.String;
|
|
4701
|
+
readonly stack: Schema.optional<Schema.String>;
|
|
4702
|
+
readonly diff: Schema.optional<Schema.String>;
|
|
4703
|
+
readonly expected: Schema.optional<Schema.String>;
|
|
4704
|
+
readonly received: Schema.optional<Schema.String>;
|
|
4705
|
+
}>>;
|
|
4706
|
+
readonly failedFiles: Schema.$Array<Schema.String>;
|
|
4707
|
+
readonly coverage: Schema.optional<Schema.Struct<{
|
|
4708
|
+
readonly totals: Schema.Struct<{
|
|
4709
|
+
readonly statements: Schema.Number;
|
|
4710
|
+
readonly branches: Schema.Number;
|
|
4711
|
+
readonly functions: Schema.Number;
|
|
4712
|
+
readonly lines: Schema.Number;
|
|
4713
|
+
}>;
|
|
4714
|
+
readonly thresholds: Schema.Struct<{
|
|
4715
|
+
readonly global: Schema.Struct<{
|
|
4716
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4717
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4718
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4719
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4720
|
+
}>;
|
|
4721
|
+
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
4722
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4723
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4724
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4725
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4726
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
4727
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4728
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4729
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4730
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4731
|
+
}>]>>;
|
|
4732
|
+
}>]>>, never>;
|
|
4733
|
+
}>;
|
|
4734
|
+
readonly targets: Schema.optional<Schema.Struct<{
|
|
4735
|
+
readonly global: Schema.Struct<{
|
|
4736
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4737
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4738
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4739
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4740
|
+
}>;
|
|
4741
|
+
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
4742
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4743
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4744
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4745
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4746
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
4747
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4748
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4749
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4750
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4751
|
+
}>]>>;
|
|
4752
|
+
}>]>>, never>;
|
|
4753
|
+
}>>;
|
|
4754
|
+
readonly baselines: Schema.optional<Schema.Struct<{
|
|
4755
|
+
readonly global: Schema.Struct<{
|
|
4756
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4757
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4758
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4759
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4760
|
+
}>;
|
|
4761
|
+
readonly patterns: Schema.withDecodingDefaultKey<Schema.$Array<Schema.Tuple<readonly [Schema.String, Schema.Struct<{
|
|
4762
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4763
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4764
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4765
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4766
|
+
readonly perFile: Schema.optionalKey<Schema.Union<readonly [Schema.Boolean, Schema.Struct<{
|
|
4767
|
+
readonly lines: Schema.optional<Schema.Number>;
|
|
4768
|
+
readonly functions: Schema.optional<Schema.Number>;
|
|
4769
|
+
readonly branches: Schema.optional<Schema.Number>;
|
|
4770
|
+
readonly statements: Schema.optional<Schema.Number>;
|
|
4771
|
+
}>]>>;
|
|
4772
|
+
}>]>>, never>;
|
|
4773
|
+
}>>;
|
|
4774
|
+
readonly scoped: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
4775
|
+
readonly scopedFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
4776
|
+
readonly totalFiles: Schema.optional<Schema.Number>;
|
|
4777
|
+
readonly lowCoverage: Schema.$Array<Schema.Struct<{
|
|
4778
|
+
readonly file: Schema.String;
|
|
4779
|
+
readonly summary: Schema.Struct<{
|
|
4780
|
+
readonly statements: Schema.Number;
|
|
4781
|
+
readonly branches: Schema.Number;
|
|
4782
|
+
readonly functions: Schema.Number;
|
|
4783
|
+
readonly lines: Schema.Number;
|
|
4784
|
+
}>;
|
|
4785
|
+
readonly uncoveredLines: Schema.String;
|
|
4786
|
+
}>>;
|
|
4787
|
+
readonly lowCoverageFiles: Schema.$Array<Schema.String>;
|
|
4788
|
+
readonly belowTarget: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
4789
|
+
readonly file: Schema.String;
|
|
4790
|
+
readonly summary: Schema.Struct<{
|
|
4791
|
+
readonly statements: Schema.Number;
|
|
4792
|
+
readonly branches: Schema.Number;
|
|
4793
|
+
readonly functions: Schema.Number;
|
|
4794
|
+
readonly lines: Schema.Number;
|
|
4795
|
+
}>;
|
|
4796
|
+
readonly uncoveredLines: Schema.String;
|
|
4797
|
+
}>>>;
|
|
4798
|
+
readonly belowTargetFiles: Schema.optional<Schema.$Array<Schema.String>>;
|
|
4799
|
+
}>>;
|
|
4800
|
+
readonly tagCounts: Schema.optional<Schema.$Record<Schema.String, Schema.Struct<{
|
|
4801
|
+
readonly passed: Schema.optional<Schema.Number>;
|
|
4802
|
+
readonly failed: Schema.optional<Schema.Number>;
|
|
4803
|
+
readonly skipped: Schema.optional<Schema.Number>;
|
|
4804
|
+
}>>>;
|
|
4805
|
+
readonly consoleLeaks: Schema.optional<Schema.Struct<{
|
|
4806
|
+
readonly total: Schema.Number;
|
|
4807
|
+
readonly byFile: Schema.$Array<Schema.Struct<{
|
|
4808
|
+
readonly file: Schema.String;
|
|
4809
|
+
readonly stdout: Schema.Number;
|
|
4810
|
+
readonly stderr: Schema.Number;
|
|
4811
|
+
readonly tests: Schema.optional<Schema.$Array<Schema.String>>;
|
|
4812
|
+
readonly sample: Schema.optional<Schema.String>;
|
|
4813
|
+
}>>;
|
|
4814
|
+
readonly truncated: Schema.optional<Schema.Boolean>;
|
|
4815
|
+
readonly fromFailingTests: Schema.optional<Schema.Struct<{
|
|
4816
|
+
readonly total: Schema.Number;
|
|
4817
|
+
readonly files: Schema.Number;
|
|
4818
|
+
}>>;
|
|
4819
|
+
}>>;
|
|
4820
|
+
}>>;
|
|
4821
|
+
}>;
|
|
4822
|
+
/** @public */
|
|
4823
|
+
export type RunReportFile = typeof RunReportFile.Type;
|
|
4824
|
+
//#endregion
|
|
4825
|
+
//#region src/schemas/TestArtifacts.d.ts
|
|
4826
|
+
/**
|
|
4827
|
+
* Source position a test annotation or test artifact points at.
|
|
4828
|
+
* @public
|
|
4829
|
+
*/
|
|
4830
|
+
export declare const TestArtifactLocation: Schema.Struct<{
|
|
4831
|
+
readonly file: Schema.String;
|
|
4832
|
+
readonly line: Schema.Number;
|
|
4833
|
+
readonly column: Schema.Number;
|
|
4834
|
+
}>;
|
|
4835
|
+
/** @public */
|
|
4836
|
+
export type TestArtifactLocation = typeof TestArtifactLocation.Type;
|
|
4837
|
+
/**
|
|
4838
|
+
* One attachment descriptor.
|
|
4839
|
+
*
|
|
4840
|
+
* `path` is the location Vitest already rewrote the attachment to
|
|
4841
|
+
* (usually under `.vitest/attachments/`) or an external `http(s)` URL —
|
|
4842
|
+
* vitest-agent never copies the file itself. `byteSize` is always
|
|
4843
|
+
* recorded so a dangling path stays describable. Vitest treats a string
|
|
4844
|
+
* `body` as base64 unless `bodyEncoding` is `"utf-8"`.
|
|
4845
|
+
*
|
|
4846
|
+
* `body` and `bodyEncoding` are populated only on the persistence path,
|
|
4847
|
+
* for inline attachments under the 64 KiB cap. Attachments carried by
|
|
4848
|
+
* `TestAnnotated` and `TestArtifactRecorded` run events are descriptors
|
|
4849
|
+
* only — never assume an event attachment has a body; read the stored
|
|
4850
|
+
* row when the bytes are needed.
|
|
4851
|
+
* @public
|
|
4852
|
+
*/
|
|
4853
|
+
export declare const TestAttachment: Schema.Struct<{
|
|
4854
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
4855
|
+
readonly path: Schema.optional<Schema.String>;
|
|
4856
|
+
readonly body: Schema.optional<Schema.String>;
|
|
4857
|
+
readonly bodyEncoding: Schema.optional<Schema.Literals<readonly ["base64", "utf-8"]>>;
|
|
4858
|
+
readonly byteSize: Schema.Number;
|
|
4859
|
+
}>;
|
|
4860
|
+
/** @public */
|
|
4861
|
+
export type TestAttachment = typeof TestAttachment.Type;
|
|
4862
|
+
/**
|
|
4863
|
+
* A test annotation as recorded by `context.annotate`.
|
|
4864
|
+
*
|
|
4865
|
+
* `type` is an arbitrary string — Vitest applies no enum
|
|
4866
|
+
* (`.repos/vitest/packages/vitest/src/runtime/runner/types.ts`).
|
|
4867
|
+
* @public
|
|
4868
|
+
*/
|
|
4869
|
+
export declare const TestAnnotation: Schema.Struct<{
|
|
4870
|
+
readonly type: Schema.String;
|
|
4871
|
+
readonly message: Schema.String;
|
|
4872
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
4873
|
+
readonly file: Schema.String;
|
|
4874
|
+
readonly line: Schema.Number;
|
|
4875
|
+
readonly column: Schema.Number;
|
|
4876
|
+
}>>;
|
|
4877
|
+
readonly attachments: Schema.$Array<Schema.Struct<{
|
|
4878
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
4879
|
+
readonly path: Schema.optional<Schema.String>;
|
|
4880
|
+
readonly body: Schema.optional<Schema.String>;
|
|
4881
|
+
readonly bodyEncoding: Schema.optional<Schema.Literals<readonly ["base64", "utf-8"]>>;
|
|
4882
|
+
readonly byteSize: Schema.Number;
|
|
4883
|
+
}>>;
|
|
4884
|
+
}>;
|
|
4885
|
+
/** @public */
|
|
4886
|
+
export type TestAnnotation = typeof TestAnnotation.Type;
|
|
4887
|
+
/**
|
|
4888
|
+
* A test artifact as recorded by `recordArtifact`.
|
|
4889
|
+
*
|
|
4890
|
+
* `data` is the JSON encoding of the artifact's custom fields, minus
|
|
4891
|
+
* `attachments` and `location` (both modelled separately). Artifacts
|
|
4892
|
+
* whose `type` starts with `internal:` are Vitest's own and are not
|
|
4893
|
+
* persisted.
|
|
4894
|
+
* @public
|
|
4895
|
+
*/
|
|
4896
|
+
export declare const TestArtifact: Schema.Struct<{
|
|
4897
|
+
readonly type: Schema.String;
|
|
4898
|
+
readonly message: Schema.optional<Schema.String>;
|
|
4899
|
+
readonly data: Schema.optional<Schema.String>;
|
|
4900
|
+
readonly location: Schema.optional<Schema.Struct<{
|
|
4901
|
+
readonly file: Schema.String;
|
|
4902
|
+
readonly line: Schema.Number;
|
|
4903
|
+
readonly column: Schema.Number;
|
|
4904
|
+
}>>;
|
|
4905
|
+
readonly attachments: Schema.$Array<Schema.Struct<{
|
|
4906
|
+
readonly contentType: Schema.optional<Schema.String>;
|
|
4907
|
+
readonly path: Schema.optional<Schema.String>;
|
|
4908
|
+
readonly body: Schema.optional<Schema.String>;
|
|
4909
|
+
readonly bodyEncoding: Schema.optional<Schema.Literals<readonly ["base64", "utf-8"]>>;
|
|
4910
|
+
readonly byteSize: Schema.Number;
|
|
4911
|
+
}>>;
|
|
4912
|
+
}>;
|
|
4913
|
+
/** @public */
|
|
4914
|
+
export type TestArtifact = typeof TestArtifact.Type;
|
|
4915
|
+
//#endregion
|
|
4334
4916
|
//#region src/schemas/turns/FileEditPayload.d.ts
|
|
4335
4917
|
/** @public */
|
|
4336
4918
|
export declare const FileEditPayload: Schema.Struct<{
|
|
@@ -5610,8 +6192,10 @@ export interface CoverageTargetsShapeResult {
|
|
|
5610
6192
|
* OR a literal `true` appears at any key other than `"100"`. The
|
|
5611
6193
|
* offending `path` is included (e.g. `"lines"`, `"src/**.ts.lines"`,
|
|
5612
6194
|
* or `"statements"` when misused as a boolean shortcut).
|
|
5613
|
-
* - `PERFILE_ON_TARGETS` —
|
|
5614
|
-
*
|
|
6195
|
+
* - `PERFILE_ON_TARGETS` — a top-level `perFile` key appears in
|
|
6196
|
+
* coverageTargets; the top-level setting belongs on
|
|
6197
|
+
* `coverage.thresholds.perFile`. A `perFile` inside a glob-pattern entry
|
|
6198
|
+
* is legal and is not reported.
|
|
5615
6199
|
*
|
|
5616
6200
|
* @param input - The raw value passed as coverageTargets.
|
|
5617
6201
|
* @returns A result object with errors, warnings, and info arrays.
|
|
@@ -5630,5 +6214,5 @@ export declare function validateCoverageTargetsShape(input: unknown): CoverageTa
|
|
|
5630
6214
|
*/
|
|
5631
6215
|
export declare const CURRENT_SDK_VERSION: string;
|
|
5632
6216
|
//#endregion
|
|
5633
|
-
export { FileCoverageReport as CoverageFile, type FormatTriageOptions, type FormatWrapupOptions, type WrapupKind, migration as migration0001, migration$1 as
|
|
6217
|
+
export { FileCoverageReport as CoverageFile, type FormatTriageOptions, type FormatWrapupOptions, type WrapupKind, migration as migration0001, migration$1 as migration0002, migration$2 as registryMigration0001, migration$3 as sessionMapMigration0001 };
|
|
5634
6218
|
//# sourceMappingURL=index.d.ts.map
|