api-tests-coverage 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard/dist/assets/_basePickBy-CYB1KXah.js +1 -0
- package/dist/dashboard/dist/assets/_baseUniq-Bwm426M6.js +1 -0
- package/dist/dashboard/dist/assets/arc-B7p8x22e.js +1 -0
- package/dist/dashboard/dist/assets/architectureDiagram-VXUJARFQ-wVr1_uNB.js +36 -0
- package/dist/dashboard/dist/assets/blockDiagram-VD42YOAC-BBXc88fn.js +122 -0
- package/dist/dashboard/dist/assets/c4Diagram-YG6GDRKO-BsgzPfQ3.js +10 -0
- package/dist/dashboard/dist/assets/channel-psxgcQ_j.js +1 -0
- package/dist/dashboard/dist/assets/chunk-4BX2VUAB-BF8loPLD.js +1 -0
- package/dist/dashboard/dist/assets/chunk-55IACEB6-C3HNF-UF.js +1 -0
- package/dist/dashboard/dist/assets/chunk-B4BG7PRW-wQ6TCEMq.js +165 -0
- package/dist/dashboard/dist/assets/chunk-DI55MBZ5-B7xHuqZu.js +220 -0
- package/dist/dashboard/dist/assets/chunk-FMBD7UC4-K3PC79JF.js +15 -0
- package/dist/dashboard/dist/assets/chunk-QN33PNHL-CmeZ1h1Z.js +1 -0
- package/dist/dashboard/dist/assets/chunk-QZHKN3VN-Cyg7Km90.js +1 -0
- package/dist/dashboard/dist/assets/chunk-TZMSLE5B-C8KNXDi7.js +1 -0
- package/dist/dashboard/dist/assets/classDiagram-2ON5EDUG-AMwn99HP.js +1 -0
- package/dist/dashboard/dist/assets/classDiagram-v2-WZHVMYZB-AMwn99HP.js +1 -0
- package/dist/dashboard/dist/assets/clone-KEkbvJY9.js +1 -0
- package/dist/dashboard/dist/assets/cose-bilkent-S5V4N54A-YL9kFxCl.js +1 -0
- package/dist/dashboard/dist/assets/dagre-6UL2VRFP-NZWnQN_Y.js +4 -0
- package/dist/dashboard/dist/assets/diagram-PSM6KHXK-DGtyS7lD.js +24 -0
- package/dist/dashboard/dist/assets/diagram-QEK2KX5R-CSCGZUfr.js +43 -0
- package/dist/dashboard/dist/assets/diagram-S2PKOQOG-DdqZVGN1.js +24 -0
- package/dist/dashboard/dist/assets/erDiagram-Q2GNP2WA-Dhb_VQMS.js +60 -0
- package/dist/dashboard/dist/assets/flowDiagram-NV44I4VS-gKUH-GJ2.js +162 -0
- package/dist/dashboard/dist/assets/ganttDiagram-JELNMOA3-Dm_lLo9y.js +267 -0
- package/dist/dashboard/dist/assets/gitGraphDiagram-V2S2FVAM-DM9AW1aP.js +65 -0
- package/dist/dashboard/dist/assets/graph-Clj85F2M.js +1 -0
- package/dist/dashboard/dist/assets/index-CqEIqNus.js +781 -0
- package/dist/dashboard/dist/assets/index-xecKLQ58.css +1 -0
- package/dist/dashboard/dist/assets/infoDiagram-HS3SLOUP-BMp4C5wf.js +2 -0
- package/dist/dashboard/dist/assets/journeyDiagram-XKPGCS4Q-BC0GSZ7W.js +139 -0
- package/dist/dashboard/dist/assets/kanban-definition-3W4ZIXB7-D6aRd_q1.js +89 -0
- package/dist/dashboard/dist/assets/layout-BbJNDkTr.js +1 -0
- package/dist/dashboard/dist/assets/mindmap-definition-VGOIOE7T-B93XW27v.js +68 -0
- package/dist/dashboard/dist/assets/pieDiagram-ADFJNKIX-9G1tEuaq.js +30 -0
- package/dist/dashboard/dist/assets/quadrantDiagram-AYHSOK5B-jDtdB4Ws.js +7 -0
- package/dist/dashboard/dist/assets/requirementDiagram-UZGBJVZJ-WIJ0qiJG.js +64 -0
- package/dist/dashboard/dist/assets/sankeyDiagram-TZEHDZUN-Cb4WB9UB.js +10 -0
- package/dist/dashboard/dist/assets/sequenceDiagram-WL72ISMW-BqGJWVUS.js +145 -0
- package/dist/dashboard/dist/assets/stateDiagram-FKZM4ZOC-0Wd-KmOv.js +1 -0
- package/dist/dashboard/dist/assets/stateDiagram-v2-4FDKWEC3-BlwaoFEG.js +1 -0
- package/dist/dashboard/dist/assets/timeline-definition-IT6M3QCI-CAmQOjBu.js +61 -0
- package/dist/dashboard/dist/assets/treemap-GDKQZRPO-CRP-WvE-.js +162 -0
- package/dist/dashboard/dist/assets/xychartDiagram-PRI3JC2R-5DoR2_q5.js +7 -0
- package/dist/dashboard/dist/index.html +2 -2
- package/dist/src/config/defaultConfig.d.ts.map +1 -1
- package/dist/src/config/defaultConfig.js +37 -0
- package/dist/src/config/types.d.ts +42 -0
- package/dist/src/config/types.d.ts.map +1 -1
- package/dist/src/config/validateConfig.d.ts.map +1 -1
- package/dist/src/config/validateConfig.js +3 -0
- package/dist/src/generation/ai-flow-exporter.d.ts +7 -0
- package/dist/src/generation/ai-flow-exporter.d.ts.map +1 -0
- package/dist/src/generation/ai-flow-exporter.js +260 -0
- package/dist/src/generation/context-builder.d.ts +16 -0
- package/dist/src/generation/context-builder.d.ts.map +1 -0
- package/dist/src/generation/context-builder.js +170 -0
- package/dist/src/generation/engine.d.ts +19 -0
- package/dist/src/generation/engine.d.ts.map +1 -0
- package/dist/src/generation/engine.js +204 -0
- package/dist/src/generation/file-router.d.ts +8 -0
- package/dist/src/generation/file-router.d.ts.map +1 -0
- package/dist/src/generation/file-router.js +98 -0
- package/dist/src/generation/gap-extractor.d.ts +7 -0
- package/dist/src/generation/gap-extractor.d.ts.map +1 -0
- package/dist/src/generation/gap-extractor.js +291 -0
- package/dist/src/generation/index.d.ts +9 -0
- package/dist/src/generation/index.d.ts.map +1 -0
- package/dist/src/generation/index.js +15 -0
- package/dist/src/generation/quality-scorer.d.ts +15 -0
- package/dist/src/generation/quality-scorer.d.ts.map +1 -0
- package/dist/src/generation/quality-scorer.js +273 -0
- package/dist/src/generation/template-renderer.d.ts +12 -0
- package/dist/src/generation/template-renderer.d.ts.map +1 -0
- package/dist/src/generation/template-renderer.js +546 -0
- package/dist/src/generation/types.d.ts +269 -0
- package/dist/src/generation/types.d.ts.map +1 -0
- package/dist/src/generation/types.js +6 -0
- package/dist/src/index.js +113 -0
- package/package.json +1 -1
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Feature 28 — Test Generation & Quality Intelligence Engine
|
|
3
|
+
* Type definitions for the test generation pipeline.
|
|
4
|
+
*/
|
|
5
|
+
export type GapType = 'endpoint' | 'parameter' | 'error' | 'business' | 'integration' | 'security' | 'auth';
|
|
6
|
+
export type GapPriority = 'P0' | 'P1' | 'P2' | 'P3' | 'P4' | 'P5';
|
|
7
|
+
export type TestType = 'unit' | 'integration' | 'cypress' | 'security';
|
|
8
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
9
|
+
export type AuthType = 'jwt' | 'basic' | 'oauth2' | 'apikey';
|
|
10
|
+
export type ParameterLocation = 'query' | 'path' | 'header' | 'body';
|
|
11
|
+
export type MissingCase = 'boundary-min' | 'boundary-max' | 'invalid-type' | 'missing-required' | 'sql-injection' | 'xss';
|
|
12
|
+
export type SecurityControlType = 'sql-injection' | 'xss' | 'auth-bypass' | 'rate-limit' | 'mass-assignment';
|
|
13
|
+
export type FileNamingConvention = 'kebab' | 'camelCase' | 'snake_case';
|
|
14
|
+
export interface DetectedGap {
|
|
15
|
+
id: string;
|
|
16
|
+
type: GapType;
|
|
17
|
+
priority: GapPriority;
|
|
18
|
+
riskScore: number;
|
|
19
|
+
endpoint: {
|
|
20
|
+
method: HttpMethod;
|
|
21
|
+
path: string;
|
|
22
|
+
operationId?: string;
|
|
23
|
+
summary?: string;
|
|
24
|
+
tags?: string[];
|
|
25
|
+
auth: {
|
|
26
|
+
required: boolean;
|
|
27
|
+
optional: boolean;
|
|
28
|
+
type?: AuthType;
|
|
29
|
+
headerName?: string;
|
|
30
|
+
scheme?: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
parameters?: ParameterInfo[];
|
|
34
|
+
responses?: ResponseInfo[];
|
|
35
|
+
businessRule?: BusinessRuleInfo;
|
|
36
|
+
securityControl?: SecurityControlInfo;
|
|
37
|
+
flow?: FlowInfo;
|
|
38
|
+
}
|
|
39
|
+
export interface ParameterInfo {
|
|
40
|
+
name: string;
|
|
41
|
+
in: ParameterLocation;
|
|
42
|
+
required: boolean;
|
|
43
|
+
schema: {
|
|
44
|
+
type: string;
|
|
45
|
+
format?: string;
|
|
46
|
+
minimum?: number;
|
|
47
|
+
maximum?: number;
|
|
48
|
+
minLength?: number;
|
|
49
|
+
maxLength?: number;
|
|
50
|
+
enum?: unknown[];
|
|
51
|
+
pattern?: string;
|
|
52
|
+
};
|
|
53
|
+
missingCases: MissingCase[];
|
|
54
|
+
}
|
|
55
|
+
export interface ResponseInfo {
|
|
56
|
+
statusCode: number;
|
|
57
|
+
description?: string;
|
|
58
|
+
schema?: unknown;
|
|
59
|
+
}
|
|
60
|
+
export interface BusinessRuleInfo {
|
|
61
|
+
id: string;
|
|
62
|
+
description: string;
|
|
63
|
+
condition: string;
|
|
64
|
+
acceptanceCriteria: string[];
|
|
65
|
+
}
|
|
66
|
+
export interface SecurityControlInfo {
|
|
67
|
+
type: SecurityControlType;
|
|
68
|
+
description: string;
|
|
69
|
+
attackVector: string;
|
|
70
|
+
expectedStatusCode: number;
|
|
71
|
+
}
|
|
72
|
+
export interface FlowInfo {
|
|
73
|
+
id: string;
|
|
74
|
+
name: string;
|
|
75
|
+
steps: Array<{
|
|
76
|
+
method: string;
|
|
77
|
+
path: string;
|
|
78
|
+
description: string;
|
|
79
|
+
}>;
|
|
80
|
+
missingStepIndex: number;
|
|
81
|
+
}
|
|
82
|
+
export interface GenerationContext {
|
|
83
|
+
gap: {
|
|
84
|
+
id: string;
|
|
85
|
+
type: GapType;
|
|
86
|
+
priority: GapPriority;
|
|
87
|
+
riskScore: number;
|
|
88
|
+
};
|
|
89
|
+
endpoint: {
|
|
90
|
+
method: string;
|
|
91
|
+
path: string;
|
|
92
|
+
pathNormalized: string;
|
|
93
|
+
operationId?: string;
|
|
94
|
+
summary?: string;
|
|
95
|
+
tags?: string[];
|
|
96
|
+
auth: {
|
|
97
|
+
required: boolean;
|
|
98
|
+
optional: boolean;
|
|
99
|
+
type?: AuthType;
|
|
100
|
+
headerName?: string;
|
|
101
|
+
scheme?: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
parameters: ParameterInfo[];
|
|
105
|
+
responses: ResponseInfo[];
|
|
106
|
+
fixtures: {
|
|
107
|
+
validPayload: Record<string, unknown>;
|
|
108
|
+
invalidPayload: Record<string, unknown>;
|
|
109
|
+
authToken: string;
|
|
110
|
+
pathParams: Record<string, string>;
|
|
111
|
+
};
|
|
112
|
+
project: {
|
|
113
|
+
name: string;
|
|
114
|
+
language: string;
|
|
115
|
+
framework: string;
|
|
116
|
+
testFramework: string;
|
|
117
|
+
baseUrl: string;
|
|
118
|
+
importPrefix: string;
|
|
119
|
+
};
|
|
120
|
+
businessRule?: BusinessRuleInfo;
|
|
121
|
+
securityControl?: SecurityControlInfo;
|
|
122
|
+
flow?: FlowInfo;
|
|
123
|
+
}
|
|
124
|
+
export interface GeneratedFile {
|
|
125
|
+
gapId: string;
|
|
126
|
+
filePath: string;
|
|
127
|
+
relativePath: string;
|
|
128
|
+
content: string;
|
|
129
|
+
testType: TestType;
|
|
130
|
+
language: string;
|
|
131
|
+
framework: string;
|
|
132
|
+
}
|
|
133
|
+
export interface GenerationResult {
|
|
134
|
+
files: GeneratedFile[];
|
|
135
|
+
dryRun: boolean;
|
|
136
|
+
totalGaps: number;
|
|
137
|
+
generatedCount: number;
|
|
138
|
+
skippedCount: number;
|
|
139
|
+
errors: Array<{
|
|
140
|
+
gapId: string;
|
|
141
|
+
message: string;
|
|
142
|
+
}>;
|
|
143
|
+
}
|
|
144
|
+
export interface GenerationOptions {
|
|
145
|
+
reportsDir: string;
|
|
146
|
+
outDir: string;
|
|
147
|
+
language?: string;
|
|
148
|
+
framework?: string;
|
|
149
|
+
priority?: GapPriority;
|
|
150
|
+
dryRun?: boolean;
|
|
151
|
+
overwrite?: boolean;
|
|
152
|
+
gapId?: string;
|
|
153
|
+
types?: GapType[];
|
|
154
|
+
noSecurity?: boolean;
|
|
155
|
+
noCypress?: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface QualityDimensions {
|
|
158
|
+
assertionDepth: number;
|
|
159
|
+
negativePathCoverage: number;
|
|
160
|
+
authCoverage: number;
|
|
161
|
+
boundaryCoverage: number;
|
|
162
|
+
testIndependence: number;
|
|
163
|
+
}
|
|
164
|
+
export interface FileQualityScore {
|
|
165
|
+
file: string;
|
|
166
|
+
score: number;
|
|
167
|
+
dimensions: QualityDimensions;
|
|
168
|
+
issues: string[];
|
|
169
|
+
strengths: string[];
|
|
170
|
+
}
|
|
171
|
+
export interface HighRiskLowQualityGap {
|
|
172
|
+
endpoint: string;
|
|
173
|
+
qualityScore: number;
|
|
174
|
+
riskScore: number;
|
|
175
|
+
primaryIssue: string;
|
|
176
|
+
}
|
|
177
|
+
export interface TestQualityReport {
|
|
178
|
+
overallScore: number;
|
|
179
|
+
byFile: FileQualityScore[];
|
|
180
|
+
lowestQualityFiles: string[];
|
|
181
|
+
highestRiskLowQualityGaps: HighRiskLowQualityGap[];
|
|
182
|
+
}
|
|
183
|
+
export interface QualityScorerOptions {
|
|
184
|
+
testsGlob?: string;
|
|
185
|
+
reportsDir?: string;
|
|
186
|
+
failBelow?: number;
|
|
187
|
+
}
|
|
188
|
+
export interface MissingTestCase {
|
|
189
|
+
id: string;
|
|
190
|
+
description: string;
|
|
191
|
+
expectedStatus: number;
|
|
192
|
+
}
|
|
193
|
+
export interface AiFlowGap {
|
|
194
|
+
gapId: string;
|
|
195
|
+
priority: GapPriority;
|
|
196
|
+
riskScore: number;
|
|
197
|
+
type: GapType;
|
|
198
|
+
endpoint: {
|
|
199
|
+
method: string;
|
|
200
|
+
path: string;
|
|
201
|
+
auth: {
|
|
202
|
+
required: boolean;
|
|
203
|
+
type?: AuthType;
|
|
204
|
+
scheme?: string;
|
|
205
|
+
};
|
|
206
|
+
};
|
|
207
|
+
missingTestCases: MissingTestCase[];
|
|
208
|
+
requestSchema?: unknown;
|
|
209
|
+
responseSchema?: unknown;
|
|
210
|
+
copilotPrompt: string;
|
|
211
|
+
suggestedOutputPath: string;
|
|
212
|
+
existingSimilarTests: string[];
|
|
213
|
+
generatedCode?: string;
|
|
214
|
+
}
|
|
215
|
+
export interface AiReadyFlows {
|
|
216
|
+
generatedAt: string;
|
|
217
|
+
project: {
|
|
218
|
+
name: string;
|
|
219
|
+
language: string;
|
|
220
|
+
testFramework: string;
|
|
221
|
+
appImportPath: string;
|
|
222
|
+
};
|
|
223
|
+
gaps: AiFlowGap[];
|
|
224
|
+
}
|
|
225
|
+
export interface AiFlowExporterOptions {
|
|
226
|
+
reportsDir: string;
|
|
227
|
+
outDir: string;
|
|
228
|
+
format?: 'markdown' | 'json' | 'both';
|
|
229
|
+
maxGaps?: number;
|
|
230
|
+
priority?: GapPriority;
|
|
231
|
+
}
|
|
232
|
+
export interface GenerationConfig {
|
|
233
|
+
enabled?: boolean;
|
|
234
|
+
outputDir?: string;
|
|
235
|
+
dryRun?: boolean;
|
|
236
|
+
overwrite?: boolean;
|
|
237
|
+
minPriority?: GapPriority;
|
|
238
|
+
unitFramework?: string;
|
|
239
|
+
integrationFramework?: string;
|
|
240
|
+
e2eFramework?: string;
|
|
241
|
+
fileNaming?: FileNamingConvention;
|
|
242
|
+
includeTypes?: GapType[];
|
|
243
|
+
securityTests?: {
|
|
244
|
+
enabled?: boolean;
|
|
245
|
+
includeInjection?: boolean;
|
|
246
|
+
includeAuthBypass?: boolean;
|
|
247
|
+
includeRateLimit?: boolean;
|
|
248
|
+
};
|
|
249
|
+
fixtures?: {
|
|
250
|
+
authTokenPlaceholder?: string;
|
|
251
|
+
baseUrl?: string;
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
export interface TestQualityConfig {
|
|
255
|
+
enabled?: boolean;
|
|
256
|
+
minimumScore?: number;
|
|
257
|
+
enforceOnGlob?: string;
|
|
258
|
+
excludeGlob?: string;
|
|
259
|
+
outputPath?: string;
|
|
260
|
+
}
|
|
261
|
+
export interface AiFlowsConfig {
|
|
262
|
+
enabled?: boolean;
|
|
263
|
+
outputDir?: string;
|
|
264
|
+
maxGapsPerExport?: number;
|
|
265
|
+
minPriority?: GapPriority;
|
|
266
|
+
includeGeneratedCode?: boolean;
|
|
267
|
+
copilotPromptMaxTokens?: number;
|
|
268
|
+
}
|
|
269
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/generation/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,OAAO,GACf,UAAU,GACV,WAAW,GACX,OAAO,GACP,UAAU,GACV,aAAa,GACb,UAAU,GACV,MAAM,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAElE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,aAAa,GAAG,SAAS,GAAG,UAAU,CAAC;AAEvE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1F,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE7D,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErE,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,cAAc,GACd,cAAc,GACd,kBAAkB,GAClB,eAAe,GACf,KAAK,CAAC;AAEV,MAAM,MAAM,mBAAmB,GAC3B,eAAe,GACf,KAAK,GACL,aAAa,GACb,YAAY,GACZ,iBAAiB,CAAC;AAEtB,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,CAAC;AAExE,MAAM,WAAW,W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
CHANGED
|
@@ -63,6 +63,7 @@ const integrationFlowInference_1 = require("./inference/integrationFlowInference
|
|
|
63
63
|
const routeInference_1 = require("./inference/routeInference");
|
|
64
64
|
const scanManifest_1 = require("./inference/scanManifest");
|
|
65
65
|
const serveDashboard_1 = require("./serveDashboard");
|
|
66
|
+
const index_4 = require("./generation/index");
|
|
66
67
|
// Register all language AST analyzers at startup.
|
|
67
68
|
// This side-effect import ensures each language module's registerAnalyzer() call runs.
|
|
68
69
|
(0, astAnalysisOrchestrator_1.registerAllAnalyzers)();
|
|
@@ -2044,6 +2045,118 @@ program
|
|
|
2044
2045
|
});
|
|
2045
2046
|
// Keep the process alive while the server runs
|
|
2046
2047
|
});
|
|
2048
|
+
program
|
|
2049
|
+
.command('generate-tests')
|
|
2050
|
+
.description('Generate test scaffolds for detected coverage gaps')
|
|
2051
|
+
.option('--reports-dir <dir>', 'Directory with coverage reports', 'reports/')
|
|
2052
|
+
.option('--out-dir <dir>', 'Output directory for generated tests', 'generated-tests/')
|
|
2053
|
+
.option('--language <lang>', 'Target language override (auto-detected if omitted)')
|
|
2054
|
+
.option('--framework <fw>', 'Test framework override (auto-detected if omitted)')
|
|
2055
|
+
.option('--priority <p>', 'Only generate for gaps at this priority or higher', 'P1')
|
|
2056
|
+
.option('--dry-run', 'Print generated tests to stdout, do not write files', false)
|
|
2057
|
+
.option('--overwrite', 'Overwrite existing generated files', false)
|
|
2058
|
+
.option('--gap-id <id>', 'Generate tests for a single specific gap')
|
|
2059
|
+
.option('--types <list>', 'Comma-separated gap types to generate (default: all)')
|
|
2060
|
+
.option('--no-security', 'Skip security test generation')
|
|
2061
|
+
.option('--no-cypress', 'Skip Cypress test generation')
|
|
2062
|
+
.action(async (options) => {
|
|
2063
|
+
const types = options.types
|
|
2064
|
+
? options.types.split(',').map(t => t.trim())
|
|
2065
|
+
: undefined;
|
|
2066
|
+
const result = await (0, index_4.generateTests)({
|
|
2067
|
+
reportsDir: options.reportsDir,
|
|
2068
|
+
outDir: options.outDir,
|
|
2069
|
+
language: options.language,
|
|
2070
|
+
framework: options.framework,
|
|
2071
|
+
priority: options.priority,
|
|
2072
|
+
dryRun: Boolean(options.dryRun),
|
|
2073
|
+
overwrite: Boolean(options.overwrite),
|
|
2074
|
+
gapId: options.gapId,
|
|
2075
|
+
types,
|
|
2076
|
+
noSecurity: Boolean(options.noSecurity),
|
|
2077
|
+
noCypress: Boolean(options.noCypress),
|
|
2078
|
+
});
|
|
2079
|
+
if (result.dryRun) {
|
|
2080
|
+
for (const file of result.files) {
|
|
2081
|
+
console.log(`\n${'='.repeat(60)}`);
|
|
2082
|
+
console.log(`// FILE: ${file.relativePath}`);
|
|
2083
|
+
console.log(`${'='.repeat(60)}`);
|
|
2084
|
+
console.log(file.content);
|
|
2085
|
+
}
|
|
2086
|
+
}
|
|
2087
|
+
else {
|
|
2088
|
+
console.log(`\nTest generation complete:`);
|
|
2089
|
+
console.log(` Gaps processed: ${result.totalGaps}`);
|
|
2090
|
+
console.log(` Files generated: ${result.generatedCount}`);
|
|
2091
|
+
console.log(` Errors: ${result.errors.length}`);
|
|
2092
|
+
if (result.errors.length > 0) {
|
|
2093
|
+
for (const err of result.errors) {
|
|
2094
|
+
console.error(` ERROR [${err.gapId}]: ${err.message}`);
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
});
|
|
2099
|
+
program
|
|
2100
|
+
.command('export-ai-flows')
|
|
2101
|
+
.description('Export AI-ready flow documentation for Copilot/Cursor/Claude')
|
|
2102
|
+
.option('--reports-dir <dir>', 'Directory with coverage reports', 'reports/')
|
|
2103
|
+
.option('--out-dir <dir>', 'Output directory for AI flow files', 'reports/')
|
|
2104
|
+
.option('--format <fmt>', 'Output format: markdown, json, or both', 'both')
|
|
2105
|
+
.option('--max-gaps <n>', 'Maximum number of gaps to include', '50')
|
|
2106
|
+
.option('--priority <p>', 'Only include gaps at this priority or higher', 'P3')
|
|
2107
|
+
.action(async (options) => {
|
|
2108
|
+
const flows = await (0, index_4.exportAiFlows)({
|
|
2109
|
+
reportsDir: options.reportsDir,
|
|
2110
|
+
outDir: options.outDir,
|
|
2111
|
+
format: options.format,
|
|
2112
|
+
maxGaps: parseInt(options.maxGaps, 10),
|
|
2113
|
+
priority: options.priority,
|
|
2114
|
+
});
|
|
2115
|
+
console.log(`\nAI flows export complete:`);
|
|
2116
|
+
console.log(` Gaps exported: ${flows.gaps.length}`);
|
|
2117
|
+
console.log(` Project: ${flows.project.name}`);
|
|
2118
|
+
console.log(` Language: ${flows.project.language}`);
|
|
2119
|
+
});
|
|
2120
|
+
program
|
|
2121
|
+
.command('score-tests')
|
|
2122
|
+
.description('Score quality of existing test suite on 5 dimensions (0-100)')
|
|
2123
|
+
.option('--tests <glob>', 'Glob pattern for test files to score', 'tests/**/*.test.ts')
|
|
2124
|
+
.option('--reports-dir <dir>', 'Directory to write quality score output', 'reports/')
|
|
2125
|
+
.option('--fail-below <score>', 'Exit non-zero if any file scores below this', '0')
|
|
2126
|
+
.action(async (options) => {
|
|
2127
|
+
var _a;
|
|
2128
|
+
try {
|
|
2129
|
+
const report = await (0, index_4.scoreTests)({
|
|
2130
|
+
testsGlob: options.tests,
|
|
2131
|
+
reportsDir: options.reportsDir,
|
|
2132
|
+
failBelow: parseInt(options.failBelow, 10),
|
|
2133
|
+
});
|
|
2134
|
+
console.log(`\nTest Quality Score Report:`);
|
|
2135
|
+
console.log(` Overall score: ${report.overallScore}/100`);
|
|
2136
|
+
console.log(` Files scored: ${report.byFile.length}`);
|
|
2137
|
+
if (report.lowestQualityFiles.length > 0) {
|
|
2138
|
+
console.log(`\n Lowest quality files:`);
|
|
2139
|
+
for (const f of report.lowestQualityFiles) {
|
|
2140
|
+
const entry = report.byFile.find(b => b.file === f);
|
|
2141
|
+
console.log(` ${f}: ${(_a = entry === null || entry === void 0 ? void 0 : entry.score) !== null && _a !== void 0 ? _a : '?'}/100`);
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
if (report.highestRiskLowQualityGaps.length > 0) {
|
|
2145
|
+
console.log(`\n High risk + low quality:`);
|
|
2146
|
+
for (const g of report.highestRiskLowQualityGaps) {
|
|
2147
|
+
console.log(` ${g.endpoint}: quality=${g.qualityScore}, risk=${g.riskScore}`);
|
|
2148
|
+
console.log(` → ${g.primaryIssue}`);
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
console.log(`\n Report written to: ${options.reportsDir}/test-quality.json`);
|
|
2152
|
+
}
|
|
2153
|
+
catch (err) {
|
|
2154
|
+
if (err instanceof Error) {
|
|
2155
|
+
console.error(err.message);
|
|
2156
|
+
}
|
|
2157
|
+
process.exit(1);
|
|
2158
|
+
}
|
|
2159
|
+
});
|
|
2047
2160
|
// Parse the command-line arguments
|
|
2048
2161
|
program.parse(process.argv);
|
|
2049
2162
|
// When invoked with no arguments (no subcommand), display help
|
package/package.json
CHANGED