codeguard-testgen 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +262 -5
- package/dist/codebaseIndexer.d.ts.map +1 -1
- package/dist/codebaseIndexer.js +2 -13
- package/dist/codebaseIndexer.js.map +1 -1
- package/dist/fuzzyMatcher.d.ts +53 -0
- package/dist/fuzzyMatcher.d.ts.map +1 -0
- package/dist/fuzzyMatcher.js +349 -0
- package/dist/fuzzyMatcher.js.map +1 -0
- package/dist/index.d.ts +19 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2158 -535
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/promptService.d.ts +0 -65
- package/dist/promptService.d.ts.map +0 -1
- package/dist/promptService.js +0 -173
- package/dist/promptService.js.map +0 -1
- package/dist/prompts.d.ts +0 -12
- package/dist/prompts.d.ts.map +0 -1
- package/dist/prompts.js +0 -470
- package/dist/prompts.js.map +0 -1
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Fuzzy Matching Utilities for Search-Replace Operations
|
|
4
|
+
* Provides multiple matching strategies for reliable code block replacement
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.normalizeWhitespace = normalizeWhitespace;
|
|
8
|
+
exports.levenshteinDistance = levenshteinDistance;
|
|
9
|
+
exports.similarityScore = similarityScore;
|
|
10
|
+
exports.contextAwareSearch = contextAwareSearch;
|
|
11
|
+
exports.smartSearch = smartSearch;
|
|
12
|
+
exports.findSimilarBlocks = findSimilarBlocks;
|
|
13
|
+
exports.getSearchFailureMessage = getSearchFailureMessage;
|
|
14
|
+
/**
|
|
15
|
+
* Normalize whitespace for comparison
|
|
16
|
+
* - Converts tabs to spaces
|
|
17
|
+
* - Normalizes line endings
|
|
18
|
+
* - Trims each line
|
|
19
|
+
* - Collapses multiple spaces
|
|
20
|
+
*/
|
|
21
|
+
function normalizeWhitespace(text) {
|
|
22
|
+
return text
|
|
23
|
+
.replace(/\r\n/g, '\n') // Normalize line endings (Windows -> Unix)
|
|
24
|
+
.replace(/\t/g, ' ') // Convert tabs to 2 spaces
|
|
25
|
+
.split('\n')
|
|
26
|
+
.map(line => line.trim()) // Trim each line
|
|
27
|
+
.join('\n')
|
|
28
|
+
.replace(/\n{3,}/g, '\n\n') // Collapse 3+ blank lines to double (preserve double blanks)
|
|
29
|
+
.trim();
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Calculate Levenshtein distance between two strings
|
|
33
|
+
* Used for fuzzy matching with a threshold
|
|
34
|
+
*/
|
|
35
|
+
function levenshteinDistance(a, b) {
|
|
36
|
+
if (a.length === 0)
|
|
37
|
+
return b.length;
|
|
38
|
+
if (b.length === 0)
|
|
39
|
+
return a.length;
|
|
40
|
+
const matrix = [];
|
|
41
|
+
// Initialize first column
|
|
42
|
+
for (let i = 0; i <= b.length; i++) {
|
|
43
|
+
matrix[i] = [i];
|
|
44
|
+
}
|
|
45
|
+
// Initialize first row
|
|
46
|
+
for (let j = 0; j <= a.length; j++) {
|
|
47
|
+
matrix[0][j] = j;
|
|
48
|
+
}
|
|
49
|
+
// Fill in the rest of the matrix
|
|
50
|
+
for (let i = 1; i <= b.length; i++) {
|
|
51
|
+
for (let j = 1; j <= a.length; j++) {
|
|
52
|
+
if (b.charAt(i - 1) === a.charAt(j - 1)) {
|
|
53
|
+
matrix[i][j] = matrix[i - 1][j - 1];
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
matrix[i][j] = Math.min(matrix[i - 1][j - 1] + 1, // substitution
|
|
57
|
+
matrix[i][j - 1] + 1, // insertion
|
|
58
|
+
matrix[i - 1][j] + 1 // deletion
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return matrix[b.length][a.length];
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Calculate similarity score (0-1) based on Levenshtein distance
|
|
67
|
+
*/
|
|
68
|
+
function similarityScore(a, b) {
|
|
69
|
+
const distance = levenshteinDistance(a, b);
|
|
70
|
+
const maxLength = Math.max(a.length, b.length);
|
|
71
|
+
if (maxLength === 0)
|
|
72
|
+
return 1.0;
|
|
73
|
+
return 1 - (distance / maxLength);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Exact string search
|
|
77
|
+
*/
|
|
78
|
+
function exactSearch(content, search) {
|
|
79
|
+
const index = content.indexOf(search);
|
|
80
|
+
if (index === -1)
|
|
81
|
+
return null;
|
|
82
|
+
return {
|
|
83
|
+
found: true,
|
|
84
|
+
startIndex: index,
|
|
85
|
+
endIndex: index + search.length,
|
|
86
|
+
confidence: 1.0,
|
|
87
|
+
originalText: search,
|
|
88
|
+
matchType: 'exact'
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Normalized whitespace search
|
|
93
|
+
* Handles differences in indentation, line endings, and spacing
|
|
94
|
+
*/
|
|
95
|
+
function normalizedSearch(content, search) {
|
|
96
|
+
const normalizedContent = normalizeWhitespace(content);
|
|
97
|
+
const normalizedSearch = normalizeWhitespace(search);
|
|
98
|
+
const index = normalizedContent.indexOf(normalizedSearch);
|
|
99
|
+
if (index === -1)
|
|
100
|
+
return null;
|
|
101
|
+
// Map back to original content position
|
|
102
|
+
// Count how many normalized characters correspond to original position
|
|
103
|
+
let originalIndex = 0;
|
|
104
|
+
let normalizedIndex = 0;
|
|
105
|
+
const contentLines = content.split('\n');
|
|
106
|
+
const normalizedLines = normalizedContent.split('\n');
|
|
107
|
+
// Find the line where match starts
|
|
108
|
+
let normalizedCharCount = 0;
|
|
109
|
+
let matchStartLine = 0;
|
|
110
|
+
for (let i = 0; i < normalizedLines.length; i++) {
|
|
111
|
+
const lineLength = normalizedLines[i].length + 1; // +1 for newline
|
|
112
|
+
if (normalizedCharCount + lineLength > index) {
|
|
113
|
+
matchStartLine = i;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
normalizedCharCount += lineLength;
|
|
117
|
+
}
|
|
118
|
+
// Calculate original start position
|
|
119
|
+
let originalStartIndex = 0;
|
|
120
|
+
for (let i = 0; i < matchStartLine; i++) {
|
|
121
|
+
originalStartIndex += contentLines[i].length + 1; // +1 for newline
|
|
122
|
+
}
|
|
123
|
+
// Add offset within the line
|
|
124
|
+
const offsetInNormalizedLine = index - normalizedCharCount;
|
|
125
|
+
const normalizedLine = normalizedLines[matchStartLine];
|
|
126
|
+
const originalLine = contentLines[matchStartLine];
|
|
127
|
+
// Simple approximation: find similar position in original line
|
|
128
|
+
const ratio = offsetInNormalizedLine / normalizedLine.length;
|
|
129
|
+
const offsetInOriginalLine = Math.floor(ratio * originalLine.length);
|
|
130
|
+
originalStartIndex += offsetInOriginalLine;
|
|
131
|
+
// Find the actual match by looking for content that normalizes to our search
|
|
132
|
+
// Try different lengths around the expected position
|
|
133
|
+
const searchLength = search.length;
|
|
134
|
+
const minLength = Math.floor(searchLength * 0.8);
|
|
135
|
+
const maxLength = Math.ceil(searchLength * 1.5);
|
|
136
|
+
for (let len = searchLength - 50; len <= searchLength + 200; len++) {
|
|
137
|
+
const candidate = content.substring(originalStartIndex, originalStartIndex + len);
|
|
138
|
+
if (normalizeWhitespace(candidate) === normalizedSearch) {
|
|
139
|
+
return {
|
|
140
|
+
found: true,
|
|
141
|
+
startIndex: originalStartIndex,
|
|
142
|
+
endIndex: originalStartIndex + len,
|
|
143
|
+
confidence: 0.95,
|
|
144
|
+
originalText: candidate,
|
|
145
|
+
matchType: 'normalized'
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// Fallback: use estimated length
|
|
150
|
+
return {
|
|
151
|
+
found: true,
|
|
152
|
+
startIndex: originalStartIndex,
|
|
153
|
+
endIndex: originalStartIndex + search.length,
|
|
154
|
+
confidence: 0.85,
|
|
155
|
+
originalText: content.substring(originalStartIndex, originalStartIndex + search.length),
|
|
156
|
+
matchType: 'normalized'
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Fuzzy search using Levenshtein distance
|
|
161
|
+
* Finds best match even with typos or small changes
|
|
162
|
+
* Optimized with sampling and early bailout to prevent hanging on large files
|
|
163
|
+
*/
|
|
164
|
+
function fuzzySearch(content, search, threshold = 0.85) {
|
|
165
|
+
const searchLength = search.length;
|
|
166
|
+
const minLength = Math.floor(searchLength * 0.7);
|
|
167
|
+
const maxLength = Math.ceil(searchLength * 1.3);
|
|
168
|
+
let bestMatch = null;
|
|
169
|
+
// Performance optimization: Use sampling for very large files
|
|
170
|
+
// If content is > 100KB and search is > 100 chars, sample every N characters
|
|
171
|
+
const contentSize = content.length;
|
|
172
|
+
const shouldSample = contentSize > 100000 && searchLength > 100;
|
|
173
|
+
const step = shouldSample ? Math.max(1, Math.floor(searchLength / 4)) : 1;
|
|
174
|
+
// Limit iterations to prevent infinite loops on huge files
|
|
175
|
+
const maxIterations = Math.min(contentSize - minLength, 50000);
|
|
176
|
+
let iterationCount = 0;
|
|
177
|
+
// Slide a window across content
|
|
178
|
+
for (let i = 0; i <= content.length - minLength; i += step) {
|
|
179
|
+
iterationCount++;
|
|
180
|
+
// Safety: bail out after max iterations
|
|
181
|
+
if (iterationCount > maxIterations) {
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
for (let len = minLength; len <= maxLength && i + len <= content.length; len++) {
|
|
185
|
+
const candidate = content.substring(i, i + len);
|
|
186
|
+
const score = similarityScore(search, candidate);
|
|
187
|
+
if (score >= threshold) {
|
|
188
|
+
if (!bestMatch || score > bestMatch.confidence) {
|
|
189
|
+
bestMatch = {
|
|
190
|
+
found: true,
|
|
191
|
+
startIndex: i,
|
|
192
|
+
endIndex: i + len,
|
|
193
|
+
confidence: score,
|
|
194
|
+
originalText: candidate,
|
|
195
|
+
matchType: 'fuzzy'
|
|
196
|
+
};
|
|
197
|
+
// If we found a near-perfect match, return immediately
|
|
198
|
+
if (score >= 0.98) {
|
|
199
|
+
return bestMatch;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return bestMatch;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Context-aware search
|
|
209
|
+
* Uses surrounding lines as anchors to find the target block
|
|
210
|
+
*/
|
|
211
|
+
function contextAwareSearch(content, search, contextLines = 3) {
|
|
212
|
+
const searchLines = search.split('\n');
|
|
213
|
+
if (searchLines.length < contextLines * 2 + 1) {
|
|
214
|
+
// Not enough context, fall back to normalized search
|
|
215
|
+
return normalizedSearch(content, search);
|
|
216
|
+
}
|
|
217
|
+
const beforeContext = searchLines.slice(0, contextLines).join('\n');
|
|
218
|
+
const afterContext = searchLines.slice(-contextLines).join('\n');
|
|
219
|
+
const target = searchLines.slice(contextLines, -contextLines).join('\n');
|
|
220
|
+
const contentLines = content.split('\n');
|
|
221
|
+
// Find before context
|
|
222
|
+
const normalizedBefore = normalizeWhitespace(beforeContext);
|
|
223
|
+
let beforeIndex = -1;
|
|
224
|
+
for (let i = 0; i <= contentLines.length - contextLines; i++) {
|
|
225
|
+
const candidate = contentLines.slice(i, i + contextLines).join('\n');
|
|
226
|
+
if (normalizeWhitespace(candidate) === normalizedBefore) {
|
|
227
|
+
beforeIndex = i;
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
if (beforeIndex === -1)
|
|
232
|
+
return null;
|
|
233
|
+
// Find after context starting from after beforeIndex
|
|
234
|
+
const normalizedAfter = normalizeWhitespace(afterContext);
|
|
235
|
+
let afterIndex = -1;
|
|
236
|
+
for (let i = beforeIndex + contextLines; i <= contentLines.length - contextLines; i++) {
|
|
237
|
+
const candidate = contentLines.slice(i, i + contextLines).join('\n');
|
|
238
|
+
if (normalizeWhitespace(candidate) === normalizedAfter) {
|
|
239
|
+
afterIndex = i;
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (afterIndex === -1)
|
|
244
|
+
return null;
|
|
245
|
+
// Extract the middle section
|
|
246
|
+
const startLine = beforeIndex + contextLines;
|
|
247
|
+
const endLine = afterIndex;
|
|
248
|
+
const matchedText = contentLines.slice(startLine, endLine).join('\n');
|
|
249
|
+
// Calculate character positions
|
|
250
|
+
let startIndex = 0;
|
|
251
|
+
for (let i = 0; i < startLine; i++) {
|
|
252
|
+
startIndex += contentLines[i].length + 1; // +1 for newline
|
|
253
|
+
}
|
|
254
|
+
let endIndex = startIndex;
|
|
255
|
+
for (let i = startLine; i < endLine; i++) {
|
|
256
|
+
endIndex += contentLines[i].length + 1;
|
|
257
|
+
}
|
|
258
|
+
return {
|
|
259
|
+
found: true,
|
|
260
|
+
startIndex,
|
|
261
|
+
endIndex: endIndex - 1, // Remove last newline
|
|
262
|
+
confidence: 0.98,
|
|
263
|
+
originalText: matchedText,
|
|
264
|
+
matchType: 'context'
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Main search function that tries multiple strategies
|
|
269
|
+
*/
|
|
270
|
+
function smartSearch(content, search, mode = 'auto') {
|
|
271
|
+
// Try exact match first (fastest)
|
|
272
|
+
if (mode === 'exact' || mode === 'auto') {
|
|
273
|
+
const exactResult = exactSearch(content, search);
|
|
274
|
+
if (exactResult)
|
|
275
|
+
return exactResult;
|
|
276
|
+
}
|
|
277
|
+
// Try normalized match (handles whitespace)
|
|
278
|
+
if (mode === 'normalized' || mode === 'auto') {
|
|
279
|
+
const normalizedResult = normalizedSearch(content, search);
|
|
280
|
+
if (normalizedResult)
|
|
281
|
+
return normalizedResult;
|
|
282
|
+
}
|
|
283
|
+
// Try context-aware if search has enough lines
|
|
284
|
+
if (mode === 'auto' && search.split('\n').length >= 7) {
|
|
285
|
+
const contextResult = contextAwareSearch(content, search);
|
|
286
|
+
if (contextResult)
|
|
287
|
+
return contextResult;
|
|
288
|
+
}
|
|
289
|
+
// Try fuzzy match (most expensive, last resort)
|
|
290
|
+
if (mode === 'fuzzy' || mode === 'auto') {
|
|
291
|
+
const fuzzyResult = fuzzySearch(content, search, 0.85);
|
|
292
|
+
if (fuzzyResult)
|
|
293
|
+
return fuzzyResult;
|
|
294
|
+
}
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Find similar blocks in content to help with debugging
|
|
299
|
+
*/
|
|
300
|
+
function findSimilarBlocks(content, search, topN = 3) {
|
|
301
|
+
const searchLength = search.length;
|
|
302
|
+
const windowSize = Math.floor(searchLength * 1.2);
|
|
303
|
+
const contentLines = content.split('\n');
|
|
304
|
+
const searchLineCount = search.split('\n').length;
|
|
305
|
+
const candidates = [];
|
|
306
|
+
// Sample blocks of similar size
|
|
307
|
+
for (let i = 0; i <= contentLines.length - searchLineCount; i++) {
|
|
308
|
+
const blockLines = contentLines.slice(i, i + searchLineCount);
|
|
309
|
+
const blockText = blockLines.join('\n');
|
|
310
|
+
const similarity = similarityScore(normalizeWhitespace(search), normalizeWhitespace(blockText));
|
|
311
|
+
if (similarity > 0.3) { // Only consider somewhat similar blocks
|
|
312
|
+
candidates.push({
|
|
313
|
+
text: blockText,
|
|
314
|
+
similarity,
|
|
315
|
+
startLine: i + 1,
|
|
316
|
+
endLine: i + searchLineCount
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// Sort by similarity and return top N
|
|
321
|
+
candidates.sort((a, b) => b.similarity - a.similarity);
|
|
322
|
+
return candidates.slice(0, topN);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Get helpful error message with suggestions
|
|
326
|
+
*/
|
|
327
|
+
function getSearchFailureMessage(content, search) {
|
|
328
|
+
const similar = findSimilarBlocks(content, search, 3);
|
|
329
|
+
let message = 'Search block not found in file.\n\n';
|
|
330
|
+
if (similar.length > 0) {
|
|
331
|
+
message += 'Most similar blocks found:\n\n';
|
|
332
|
+
similar.forEach((block, idx) => {
|
|
333
|
+
message += `${idx + 1}. Lines ${block.startLine}-${block.endLine} (${Math.round(block.similarity * 100)}% similar):\n`;
|
|
334
|
+
message += '```\n';
|
|
335
|
+
message += block.text.split('\n').slice(0, 5).join('\n');
|
|
336
|
+
if (block.text.split('\n').length > 5) {
|
|
337
|
+
message += '\n... (truncated)';
|
|
338
|
+
}
|
|
339
|
+
message += '\n```\n\n';
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
message += 'Tips:\n';
|
|
343
|
+
message += '- Include more context lines (3-5 lines before/after) to make search unique\n';
|
|
344
|
+
message += '- Check for typos in your search block\n';
|
|
345
|
+
message += '- Verify the file hasn\'t changed since you last read it\n';
|
|
346
|
+
message += '- Try using read_file to see current file contents\n';
|
|
347
|
+
return message;
|
|
348
|
+
}
|
|
349
|
+
//# sourceMappingURL=fuzzyMatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fuzzyMatcher.js","sourceRoot":"","sources":["../src/fuzzyMatcher.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAyBH,kDASC;AAMD,kDAgCC;AAKD,0CAKC;AA+JD,gDAsEC;AAKD,kCA8BC;AAKD,8CAkCC;AAKD,0DA4BC;AAhZD;;;;;;GAMG;AACH,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,OAAO,IAAI;SACR,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAQ,2CAA2C;SACzE,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAW,2BAA2B;SAC1D,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAO,iBAAiB;SAChD,IAAI,CAAC,IAAI,CAAC;SACV,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAK,6DAA6D;SAC5F,IAAI,EAAE,CAAC;AACZ,CAAC;AAED;;;GAGG;AACH,SAAgB,mBAAmB,CAAC,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AI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtC,OAAO,IAAI,mBAAmB,CAAC;YACjC,CAAC;YACD,OAAO,IAAI,WAAW,CAAC;QACzB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAI,SAAS,CAAC;IACrB,OAAO,IAAI,+EAA+E,CAAC;IAC3F,OAAO,IAAI,0CAA0C,CAAC;IACtD,OAAO,IAAI,4DAA4D,CAAC;IACxE,OAAO,IAAI,sDAAsD,CAAC;IAElE,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,11 +32,29 @@ declare function replaceFunctionTests(testFilePath: string, functionName: string
|
|
|
32
32
|
declare function deleteLines(filePath: string, startLine: number, endLine: number): Promise<any>;
|
|
33
33
|
declare function insertLines(filePath: string, lineNumber: number, content: string): Promise<any>;
|
|
34
34
|
declare function replaceLines(filePath: string, startLine: number, endLine: number, newContent: string): Promise<any>;
|
|
35
|
+
/**
|
|
36
|
+
* Search and replace a code block using fuzzy matching
|
|
37
|
+
* Much more reliable than line-based editing!
|
|
38
|
+
*/
|
|
39
|
+
declare function searchReplaceBlock(filePath: string, search: string, replace: string, matchMode?: 'exact' | 'normalized' | 'fuzzy'): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* Insert content at a specific position in the file
|
|
42
|
+
* Simpler than search_replace_block for adding new content
|
|
43
|
+
*/
|
|
44
|
+
declare function insertAtPosition(filePath: string, content: string, position?: 'beginning' | 'end' | 'after_imports' | 'before_first_describe', afterMarker?: string): Promise<any>;
|
|
35
45
|
declare function executeTool(toolName: string, args: any): Promise<any>;
|
|
36
46
|
declare function generateTests(sourceFile: string): Promise<string>;
|
|
37
47
|
declare function generateTestsForFolder(): Promise<void>;
|
|
48
|
+
/** [Not useful, introduce side-effect]
|
|
49
|
+
* Validate and fix the complete test file after all functions are processed
|
|
50
|
+
* Runs full test suite and fixes file-level issues (mock pollution, imports, etc)
|
|
51
|
+
*/
|
|
52
|
+
declare function validateAndFixCompleteTestFile(sourceFile: string, testFilePath: string, functionNames: string[]): Promise<void>;
|
|
53
|
+
/**
|
|
54
|
+
* Generate tests for multiple functions, one at a time
|
|
55
|
+
*/
|
|
38
56
|
declare function generateTestsForFunctions(sourceFile: string, functionNames: string[]): Promise<string>;
|
|
39
57
|
declare function generateTestsForFunction(): Promise<void>;
|
|
40
58
|
declare function main(): Promise<void>;
|
|
41
|
-
export { main, generateTests, generateTestsForFolder, generateTestsForFunction, generateTestsForFunctions, executeTool, analyzeFileAST, getFunctionAST, getImportsAST, getTypeDefinitions, getClassMethods, replaceFunctionTests, deleteLines, insertLines, replaceLines, CodebaseIndexer, TOOLS };
|
|
59
|
+
export { main, generateTests, generateTestsForFolder, generateTestsForFunction, generateTestsForFunctions, validateAndFixCompleteTestFile, executeTool, analyzeFileAST, getFunctionAST, getImportsAST, getTypeDefinitions, getClassMethods, replaceFunctionTests, searchReplaceBlock, insertAtPosition, deleteLines, insertLines, replaceLines, CodebaseIndexer, TOOLS };
|
|
42
60
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAaH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;GAYG;AAaH,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAsCpD,UAAU,IAAI;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;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