@vibe-validate/extractors 0.16.1 → 0.17.0-rc.5
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/extractor-registry.d.ts +104 -0
- package/dist/extractor-registry.d.ts.map +1 -0
- package/dist/extractor-registry.js +278 -0
- package/dist/extractor-registry.js.map +1 -0
- package/dist/extractors/ava/index.d.ts +23 -0
- package/dist/extractors/ava/index.d.ts.map +1 -0
- package/dist/extractors/ava/index.js +507 -0
- package/dist/extractors/ava/index.js.map +1 -0
- package/dist/extractors/ava/index.test.d.ts +7 -0
- package/dist/extractors/ava/index.test.d.ts.map +1 -0
- package/dist/extractors/ava/index.test.js +408 -0
- package/dist/extractors/ava/index.test.js.map +1 -0
- package/dist/extractors/eslint/index.d.ts +18 -0
- package/dist/extractors/eslint/index.d.ts.map +1 -0
- package/dist/extractors/eslint/index.js +206 -0
- package/dist/extractors/eslint/index.js.map +1 -0
- package/dist/extractors/eslint/index.test.d.ts +9 -0
- package/dist/extractors/eslint/index.test.d.ts.map +1 -0
- package/dist/extractors/eslint/index.test.js +191 -0
- package/dist/extractors/eslint/index.test.js.map +1 -0
- package/dist/extractors/generic/index.d.ts +30 -0
- package/dist/extractors/generic/index.d.ts.map +1 -0
- package/dist/extractors/generic/index.js +140 -0
- package/dist/extractors/generic/index.js.map +1 -0
- package/dist/extractors/generic/index.test.d.ts +7 -0
- package/dist/extractors/generic/index.test.d.ts.map +1 -0
- package/dist/extractors/generic/index.test.js +61 -0
- package/dist/extractors/generic/index.test.js.map +1 -0
- package/dist/extractors/jasmine/index.d.ts +17 -0
- package/dist/extractors/jasmine/index.d.ts.map +1 -0
- package/dist/extractors/jasmine/index.js +242 -0
- package/dist/extractors/jasmine/index.js.map +1 -0
- package/dist/extractors/jasmine/index.test.d.ts +7 -0
- package/dist/extractors/jasmine/index.test.d.ts.map +1 -0
- package/dist/extractors/jasmine/index.test.js +318 -0
- package/dist/extractors/jasmine/index.test.js.map +1 -0
- package/dist/extractors/jest/index.d.ts +17 -0
- package/dist/extractors/jest/index.d.ts.map +1 -0
- package/dist/extractors/jest/index.js +273 -0
- package/dist/extractors/jest/index.js.map +1 -0
- package/dist/extractors/jest/index.test.d.ts +9 -0
- package/dist/extractors/jest/index.test.d.ts.map +1 -0
- package/dist/extractors/jest/index.test.js +338 -0
- package/dist/extractors/jest/index.test.js.map +1 -0
- package/dist/extractors/junit/index.d.ts +18 -0
- package/dist/extractors/junit/index.d.ts.map +1 -0
- package/dist/extractors/junit/index.js +259 -0
- package/dist/extractors/junit/index.js.map +1 -0
- package/dist/extractors/junit/index.test.d.ts +7 -0
- package/dist/extractors/junit/index.test.d.ts.map +1 -0
- package/dist/extractors/junit/index.test.js +341 -0
- package/dist/extractors/junit/index.test.js.map +1 -0
- package/dist/extractors/maven-checkstyle/index.d.ts +23 -0
- package/dist/extractors/maven-checkstyle/index.d.ts.map +1 -0
- package/dist/extractors/maven-checkstyle/index.js +263 -0
- package/dist/extractors/maven-checkstyle/index.js.map +1 -0
- package/dist/extractors/maven-checkstyle/index.test.d.ts +2 -0
- package/dist/extractors/maven-checkstyle/index.test.d.ts.map +1 -0
- package/dist/extractors/maven-checkstyle/index.test.js +197 -0
- package/dist/extractors/maven-checkstyle/index.test.js.map +1 -0
- package/dist/extractors/maven-compiler/index.d.ts +23 -0
- package/dist/extractors/maven-compiler/index.d.ts.map +1 -0
- package/dist/extractors/maven-compiler/index.js +271 -0
- package/dist/extractors/maven-compiler/index.js.map +1 -0
- package/dist/extractors/maven-compiler/index.test.d.ts +2 -0
- package/dist/extractors/maven-compiler/index.test.d.ts.map +1 -0
- package/dist/extractors/maven-compiler/index.test.js +189 -0
- package/dist/extractors/maven-compiler/index.test.js.map +1 -0
- package/dist/extractors/maven-surefire/index.d.ts +23 -0
- package/dist/extractors/maven-surefire/index.d.ts.map +1 -0
- package/dist/extractors/maven-surefire/index.js +292 -0
- package/dist/extractors/maven-surefire/index.js.map +1 -0
- package/dist/extractors/maven-surefire/index.test.d.ts +2 -0
- package/dist/extractors/maven-surefire/index.test.d.ts.map +1 -0
- package/dist/extractors/maven-surefire/index.test.js +163 -0
- package/dist/extractors/maven-surefire/index.test.js.map +1 -0
- package/dist/extractors/mocha/index.d.ts +17 -0
- package/dist/extractors/mocha/index.d.ts.map +1 -0
- package/dist/extractors/mocha/index.js +241 -0
- package/dist/extractors/mocha/index.js.map +1 -0
- package/dist/extractors/mocha/index.test.d.ts +7 -0
- package/dist/extractors/mocha/index.test.d.ts.map +1 -0
- package/dist/extractors/mocha/index.test.js +300 -0
- package/dist/extractors/mocha/index.test.js.map +1 -0
- package/dist/extractors/playwright/index.d.ts +17 -0
- package/dist/extractors/playwright/index.d.ts.map +1 -0
- package/dist/extractors/playwright/index.js +320 -0
- package/dist/extractors/playwright/index.js.map +1 -0
- package/dist/extractors/playwright/index.test.d.ts +7 -0
- package/dist/extractors/playwright/index.test.d.ts.map +1 -0
- package/dist/extractors/playwright/index.test.js +274 -0
- package/dist/extractors/playwright/index.test.js.map +1 -0
- package/dist/extractors/tap/index.d.ts +23 -0
- package/dist/extractors/tap/index.d.ts.map +1 -0
- package/dist/extractors/tap/index.js +352 -0
- package/dist/extractors/tap/index.js.map +1 -0
- package/dist/extractors/tap/index.test.d.ts +7 -0
- package/dist/extractors/tap/index.test.d.ts.map +1 -0
- package/dist/extractors/tap/index.test.js +100 -0
- package/dist/extractors/tap/index.test.js.map +1 -0
- package/dist/extractors/typescript/index.d.ts +17 -0
- package/dist/extractors/typescript/index.d.ts.map +1 -0
- package/dist/extractors/typescript/index.js +150 -0
- package/dist/extractors/typescript/index.js.map +1 -0
- package/dist/extractors/typescript/index.test.d.ts +9 -0
- package/dist/extractors/typescript/index.test.d.ts.map +1 -0
- package/dist/extractors/typescript/index.test.js +177 -0
- package/dist/extractors/typescript/index.test.js.map +1 -0
- package/dist/extractors/vitest/index.d.ts +17 -0
- package/dist/extractors/vitest/index.d.ts.map +1 -0
- package/dist/extractors/vitest/index.js +564 -0
- package/dist/extractors/vitest/index.js.map +1 -0
- package/dist/extractors/vitest/index.test.d.ts +9 -0
- package/dist/extractors/vitest/index.test.d.ts.map +1 -0
- package/dist/extractors/vitest/index.test.js +373 -0
- package/dist/extractors/vitest/index.test.js.map +1 -0
- package/dist/index.d.ts +27 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -11
- package/dist/index.js.map +1 -1
- package/dist/maven-checkstyle-extractor.d.ts +20 -0
- package/dist/maven-checkstyle-extractor.d.ts.map +1 -0
- package/dist/maven-checkstyle-extractor.js +193 -0
- package/dist/maven-checkstyle-extractor.js.map +1 -0
- package/dist/maven-compiler-extractor.d.ts +20 -0
- package/dist/maven-compiler-extractor.d.ts.map +1 -0
- package/dist/maven-compiler-extractor.js +218 -0
- package/dist/maven-compiler-extractor.js.map +1 -0
- package/dist/maven-surefire-extractor.d.ts +20 -0
- package/dist/maven-surefire-extractor.d.ts.map +1 -0
- package/dist/maven-surefire-extractor.js +228 -0
- package/dist/maven-surefire-extractor.js.map +1 -0
- package/dist/maven-utils.d.ts +24 -0
- package/dist/maven-utils.d.ts.map +1 -0
- package/dist/maven-utils.js +36 -0
- package/dist/maven-utils.js.map +1 -0
- package/dist/plugin-loader.d.ts +82 -0
- package/dist/plugin-loader.d.ts.map +1 -0
- package/dist/plugin-loader.js +200 -0
- package/dist/plugin-loader.js.map +1 -0
- package/dist/sandbox.d.ts +161 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/sandbox.js +254 -0
- package/dist/sandbox.js.map +1 -0
- package/dist/sandbox.test.d.ts +8 -0
- package/dist/sandbox.test.d.ts.map +1 -0
- package/dist/sandbox.test.js +395 -0
- package/dist/sandbox.test.js.map +1 -0
- package/dist/sandboxed-extractor.d.ts +46 -0
- package/dist/sandboxed-extractor.d.ts.map +1 -0
- package/dist/sandboxed-extractor.js +172 -0
- package/dist/sandboxed-extractor.js.map +1 -0
- package/dist/sandboxed-extractor.test.d.ts +5 -0
- package/dist/sandboxed-extractor.test.d.ts.map +1 -0
- package/dist/sandboxed-extractor.test.js +346 -0
- package/dist/sandboxed-extractor.test.js.map +1 -0
- package/dist/smart-extractor.d.ts +22 -10
- package/dist/smart-extractor.d.ts.map +1 -1
- package/dist/smart-extractor.js +116 -163
- package/dist/smart-extractor.js.map +1 -1
- package/dist/types.d.ts +94 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,564 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest/Jest Error Extractor Plugin
|
|
3
|
+
*
|
|
4
|
+
* Parses and formats Vitest (and Jest) test failure output for LLM consumption.
|
|
5
|
+
*
|
|
6
|
+
* @package @vibe-validate/extractors
|
|
7
|
+
*/
|
|
8
|
+
import { MAX_ERRORS_IN_ARRAY } from '../../result-schema.js';
|
|
9
|
+
/**
|
|
10
|
+
* Parse failure line to determine format and extract initial data
|
|
11
|
+
*
|
|
12
|
+
* @param line - Current line being parsed
|
|
13
|
+
* @param currentFile - File path from Format 2 header
|
|
14
|
+
* @param hasFormat2 - Whether Format 2 has been detected
|
|
15
|
+
* @returns Partial failure object or null if no match
|
|
16
|
+
*
|
|
17
|
+
* @internal
|
|
18
|
+
*/
|
|
19
|
+
function parseFailureLine(line, currentFile, hasFormat2) {
|
|
20
|
+
// Match Format 1: FAIL file.test.ts > test hierarchy
|
|
21
|
+
// BUT: Skip if we've seen Format 2 headers (to avoid processing duplicate FAIL lines)
|
|
22
|
+
const format1Match = !hasFormat2 && /(?:FAIL|❌|×)\s+([^\s]+\.test\.ts)\s*>\s*(.+)/.exec(line);
|
|
23
|
+
if (format1Match) {
|
|
24
|
+
return {
|
|
25
|
+
file: format1Match[1],
|
|
26
|
+
testHierarchy: format1Match[2].trim(),
|
|
27
|
+
errorMessage: '',
|
|
28
|
+
sourceLine: '',
|
|
29
|
+
location: ''
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
// Match Format 2: × test hierarchy (without file path)
|
|
33
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Vitest test framework output (controlled output), limited line length
|
|
34
|
+
const format2Match = /(?:×)\s+(.+?)(?:\s+\d+ms)?$/.exec(line);
|
|
35
|
+
if (format2Match && currentFile) {
|
|
36
|
+
return {
|
|
37
|
+
file: currentFile,
|
|
38
|
+
testHierarchy: format2Match[1].trim(),
|
|
39
|
+
errorMessage: '',
|
|
40
|
+
sourceLine: '',
|
|
41
|
+
location: ''
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Extract initial error message from line
|
|
48
|
+
*
|
|
49
|
+
* @param line - Line to extract error from
|
|
50
|
+
* @returns Extracted error message
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
*/
|
|
54
|
+
function extractErrorMessage(line) {
|
|
55
|
+
const errorMatch = /((?:AssertionError|Error):\s*.+)/.exec(line);
|
|
56
|
+
if (errorMatch) {
|
|
57
|
+
return errorMatch[1].trim();
|
|
58
|
+
}
|
|
59
|
+
const format2ErrorMatch = /→\s+(.+)/.exec(line);
|
|
60
|
+
if (format2ErrorMatch) {
|
|
61
|
+
return format2ErrorMatch[1].trim();
|
|
62
|
+
}
|
|
63
|
+
return line.trim();
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Check if line is a stop marker for error continuation
|
|
67
|
+
*
|
|
68
|
+
* @param line - Trimmed line to check
|
|
69
|
+
* @returns True if this line marks end of error message
|
|
70
|
+
*
|
|
71
|
+
* @internal
|
|
72
|
+
*/
|
|
73
|
+
function isStopMarker(line) {
|
|
74
|
+
return (line.startsWith('❯') ||
|
|
75
|
+
/^\d+\|/.test(line) ||
|
|
76
|
+
line.startsWith('FAIL') ||
|
|
77
|
+
line.startsWith('✓') ||
|
|
78
|
+
line.startsWith('❌') ||
|
|
79
|
+
line.startsWith('×') ||
|
|
80
|
+
line.startsWith('⎯') ||
|
|
81
|
+
line.startsWith('at '));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Append continuation line to error message
|
|
85
|
+
*
|
|
86
|
+
* @param errorMessage - Current error message
|
|
87
|
+
* @param line - Raw line (with indentation)
|
|
88
|
+
* @param trimmedLine - Trimmed version of line
|
|
89
|
+
* @param isSnapshotError - Whether handling snapshot error
|
|
90
|
+
* @returns Updated error message
|
|
91
|
+
*
|
|
92
|
+
* @internal
|
|
93
|
+
*/
|
|
94
|
+
function appendContinuationLine(errorMessage, line, trimmedLine, isSnapshotError) {
|
|
95
|
+
if (isSnapshotError) {
|
|
96
|
+
return errorMessage + '\n' + line; // Preserve indentation for diffs
|
|
97
|
+
}
|
|
98
|
+
return errorMessage + ' ' + trimmedLine; // Compact for normal errors
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Handle truncation logic for non-snapshot errors
|
|
102
|
+
*
|
|
103
|
+
* @param errorMessage - Current error message
|
|
104
|
+
* @param nextLine - Next trimmed line
|
|
105
|
+
* @param isSnapshotError - Whether handling snapshot error
|
|
106
|
+
* @param linesConsumed - Number of lines consumed so far
|
|
107
|
+
* @param maxLines - Maximum continuation lines allowed
|
|
108
|
+
* @returns Object with updated message and whether to stop
|
|
109
|
+
*
|
|
110
|
+
* @internal
|
|
111
|
+
*/
|
|
112
|
+
function handleTruncation(errorMessage, nextLine, isSnapshotError, linesConsumed, maxLines) {
|
|
113
|
+
if (isSnapshotError || linesConsumed < maxLines) {
|
|
114
|
+
return { errorMessage, shouldStop: false };
|
|
115
|
+
}
|
|
116
|
+
const updatedMessage = nextLine ? errorMessage + ' ...(truncated)' : errorMessage;
|
|
117
|
+
return { errorMessage: updatedMessage, shouldStop: true };
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Parse error message with continuation line handling
|
|
121
|
+
*
|
|
122
|
+
* @param lines - All output lines
|
|
123
|
+
* @param startIndex - Index where error message starts
|
|
124
|
+
* @param isSnapshotError - Whether this is a snapshot error (different continuation rules)
|
|
125
|
+
* @returns Error message and index of last consumed line
|
|
126
|
+
*
|
|
127
|
+
* @internal
|
|
128
|
+
*/
|
|
129
|
+
function parseErrorMessage(lines, startIndex, isSnapshotError) {
|
|
130
|
+
let errorMessage = extractErrorMessage(lines[startIndex]);
|
|
131
|
+
const MAX_CONTINUATION_LINES = 5;
|
|
132
|
+
let j = startIndex + 1;
|
|
133
|
+
let linesConsumed = 0;
|
|
134
|
+
while (j < lines.length) {
|
|
135
|
+
const nextLine = lines[j].trim();
|
|
136
|
+
if (isStopMarker(nextLine)) {
|
|
137
|
+
break;
|
|
138
|
+
}
|
|
139
|
+
// Check truncation limit for non-snapshot errors
|
|
140
|
+
const truncation = handleTruncation(errorMessage, nextLine, isSnapshotError, linesConsumed, MAX_CONTINUATION_LINES);
|
|
141
|
+
if (truncation.shouldStop) {
|
|
142
|
+
errorMessage = truncation.errorMessage;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
// For non-snapshot errors, stop at blank lines
|
|
146
|
+
if (!nextLine && !isSnapshotError) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
// Add line to error message
|
|
150
|
+
if (nextLine || isSnapshotError) {
|
|
151
|
+
errorMessage = appendContinuationLine(errorMessage, lines[j], nextLine, isSnapshotError);
|
|
152
|
+
if (!isSnapshotError) {
|
|
153
|
+
linesConsumed++;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
j++;
|
|
157
|
+
}
|
|
158
|
+
return { errorMessage, lastIndex: j - 1 };
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Parse location from vitest marker or stack trace
|
|
162
|
+
*
|
|
163
|
+
* @param line - Line to parse
|
|
164
|
+
* @returns Location string (file:line:column) or null
|
|
165
|
+
*
|
|
166
|
+
* @internal
|
|
167
|
+
*/
|
|
168
|
+
function parseLocation(line) {
|
|
169
|
+
// Try vitest location marker first
|
|
170
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Vitest test framework location markers (controlled output), not user input
|
|
171
|
+
const vitestLocation = /❯\s*(.+\.test\.ts):(\d+):(\d+)/.exec(line);
|
|
172
|
+
if (vitestLocation) {
|
|
173
|
+
return `${vitestLocation[1]}:${vitestLocation[2]}:${vitestLocation[3]}`;
|
|
174
|
+
}
|
|
175
|
+
// Try stack trace pattern
|
|
176
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Vitest test framework stack traces (controlled output), not user input
|
|
177
|
+
const stackLocation = /at\s+.+\(([^\s]+\.test\.ts):(\d+):(\d+)\)/.exec(line);
|
|
178
|
+
if (stackLocation) {
|
|
179
|
+
return `${stackLocation[1]}:${stackLocation[2]}:${stackLocation[3]}`;
|
|
180
|
+
}
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Format failures into clean output
|
|
185
|
+
*
|
|
186
|
+
* @param failures - Extracted test failures
|
|
187
|
+
* @param expected - Expected value (if present)
|
|
188
|
+
* @param actual - Actual value (if present)
|
|
189
|
+
* @returns Formatted output string
|
|
190
|
+
*
|
|
191
|
+
* @internal
|
|
192
|
+
*/
|
|
193
|
+
function formatFailuresOutput(failures, expected, actual) {
|
|
194
|
+
return failures
|
|
195
|
+
.slice(0, MAX_ERRORS_IN_ARRAY)
|
|
196
|
+
.map((f, idx) => {
|
|
197
|
+
const parts = [
|
|
198
|
+
`[Test ${idx + 1}/${failures.length}] ${f.location ?? f.file}`,
|
|
199
|
+
'',
|
|
200
|
+
`Test: ${f.testHierarchy}`,
|
|
201
|
+
`Error: ${f.errorMessage}`,
|
|
202
|
+
];
|
|
203
|
+
if (expected && actual) {
|
|
204
|
+
parts.push(`Expected: ${expected}`, `Actual: ${actual}`);
|
|
205
|
+
}
|
|
206
|
+
if (f.sourceLine) {
|
|
207
|
+
parts.push('', f.sourceLine);
|
|
208
|
+
}
|
|
209
|
+
return parts.filter(p => p).join('\n');
|
|
210
|
+
})
|
|
211
|
+
.join('\n\n');
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Generate LLM-friendly guidance based on failures
|
|
215
|
+
*
|
|
216
|
+
* @param failureCount - Number of failures
|
|
217
|
+
* @param expected - Expected value (if present)
|
|
218
|
+
* @param actual - Actual value (if present)
|
|
219
|
+
* @param hasTimeout - Whether any failures are due to timeout
|
|
220
|
+
* @returns Guidance text
|
|
221
|
+
*
|
|
222
|
+
* @internal
|
|
223
|
+
*/
|
|
224
|
+
function generateGuidanceText(failureCount, expected, actual, hasTimeout) {
|
|
225
|
+
let guidance = `${failureCount} test(s) failed. `;
|
|
226
|
+
// Timeout-specific guidance
|
|
227
|
+
if (hasTimeout) {
|
|
228
|
+
guidance += 'Test(s) timed out. ';
|
|
229
|
+
if (failureCount === 1) {
|
|
230
|
+
guidance += 'Options: 1) Increase timeout with test.timeout() or testTimeout config, ';
|
|
231
|
+
guidance += '2) Optimize test to run faster, ';
|
|
232
|
+
guidance += '3) Mock slow operations (API calls, file I/O, child processes). ';
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
guidance += 'Multiple tests timing out suggests resource constraints. ';
|
|
236
|
+
guidance += 'Try: 1) Run tests individually to identify slow tests, ';
|
|
237
|
+
guidance += '2) Increase testTimeout config, ';
|
|
238
|
+
guidance += '3) Reduce parallel test workers (--pool-workers=2). ';
|
|
239
|
+
}
|
|
240
|
+
guidance += 'Run: npm test -- <test-file> to verify the fix.';
|
|
241
|
+
return guidance;
|
|
242
|
+
}
|
|
243
|
+
// Standard assertion failure guidance
|
|
244
|
+
if (failureCount === 1) {
|
|
245
|
+
guidance += 'Fix the assertion in the test file at the location shown. ';
|
|
246
|
+
if (expected && actual) {
|
|
247
|
+
guidance += `The test expected "${expected}" but got "${actual}". `;
|
|
248
|
+
}
|
|
249
|
+
guidance += 'Run: npm test -- <test-file> to verify the fix.';
|
|
250
|
+
}
|
|
251
|
+
else {
|
|
252
|
+
guidance += 'Fix each failing test individually. Run: npm test -- <test-file> to test each file.';
|
|
253
|
+
}
|
|
254
|
+
return guidance;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Extract runtime errors (Unhandled Rejection, ENOENT, etc.)
|
|
258
|
+
*
|
|
259
|
+
* @param output - Full test output
|
|
260
|
+
* @returns Test failure object if runtime error found
|
|
261
|
+
*/
|
|
262
|
+
function extractRuntimeError(output) {
|
|
263
|
+
// Look for "Unhandled Rejection" section
|
|
264
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Vitest test framework runtime errors (controlled output), not user input
|
|
265
|
+
const unhandledMatch = /⎯+\s*Unhandled Rejection\s*⎯+\s*\n\s*(Error:[^\n]+(?:\n\s*[^\n❯⎯]+)?)/.exec(output);
|
|
266
|
+
if (!unhandledMatch) {
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
// Error message may span multiple lines (e.g., path on next line)
|
|
270
|
+
const errorMessage = unhandledMatch[1].trim().replace(/\n\s+/g, ' ');
|
|
271
|
+
// Extract location from stack trace (❯ function file:line:col)
|
|
272
|
+
// File path may contain colons (e.g., node:internal/fs/promises), so match ❯ function filepath:number:number
|
|
273
|
+
const locationMatch = /❯\s+\S+\s+([\w:/.]+):(\d+):(\d+)/.exec(output);
|
|
274
|
+
let file = 'unknown';
|
|
275
|
+
let location = '';
|
|
276
|
+
if (locationMatch) {
|
|
277
|
+
file = locationMatch[1];
|
|
278
|
+
location = `${locationMatch[1]}:${locationMatch[2]}:${locationMatch[3]}`;
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
file,
|
|
282
|
+
location,
|
|
283
|
+
testHierarchy: 'Runtime Error',
|
|
284
|
+
errorMessage,
|
|
285
|
+
sourceLine: ''
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Extract coverage threshold failures
|
|
290
|
+
*
|
|
291
|
+
* @param output - Full test output
|
|
292
|
+
* @returns Test failure object if coverage threshold error found
|
|
293
|
+
*/
|
|
294
|
+
function extractCoverageThresholdError(output) {
|
|
295
|
+
// Look for: "ERROR: Coverage for functions (86.47%) does not meet global threshold (87%)"
|
|
296
|
+
const coverageMatch = /ERROR:\s+Coverage for (\w+) \(([\d.]+)%\) does not meet (?:global )?threshold \(([\d.]+)%\)/.exec(output);
|
|
297
|
+
if (!coverageMatch) {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
const [, metric, actual, expected] = coverageMatch;
|
|
301
|
+
return {
|
|
302
|
+
file: 'vitest.config.ts',
|
|
303
|
+
location: '',
|
|
304
|
+
testHierarchy: 'Coverage Threshold',
|
|
305
|
+
errorMessage: `Coverage for ${metric} (${actual}%) does not meet threshold (${expected}%)`,
|
|
306
|
+
sourceLine: ''
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Extract Vitest worker timeout errors
|
|
311
|
+
*
|
|
312
|
+
* These occur when Vitest worker threads timeout during test execution,
|
|
313
|
+
* often due to system resource constraints or competing processes.
|
|
314
|
+
*
|
|
315
|
+
* @param output - Full test output
|
|
316
|
+
* @returns Test failure object if worker timeout error found
|
|
317
|
+
*/
|
|
318
|
+
function extractVitestWorkerTimeoutError(output) {
|
|
319
|
+
// Look for: "⎯⎯⎯⎯⎯⎯ Unhandled Error(s) ⎯⎯⎯⎯⎯⎯⎯\nError: [vitest-worker]: Timeout calling..."
|
|
320
|
+
// Handles both singular "Unhandled Error" and plural "Unhandled Errors"
|
|
321
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Vitest test framework error output (controlled output), not user input
|
|
322
|
+
const timeoutMatch = /⎯+\s*Unhandled Errors?\s*⎯+\s*\n\s*Error:\s*\[vitest-worker\]:\s*(Timeout[^\n]+)/.exec(output);
|
|
323
|
+
if (!timeoutMatch) {
|
|
324
|
+
return null;
|
|
325
|
+
}
|
|
326
|
+
const errorMessage = timeoutMatch[1].trim();
|
|
327
|
+
return {
|
|
328
|
+
file: 'vitest.config.ts',
|
|
329
|
+
location: '',
|
|
330
|
+
testHierarchy: 'Vitest Worker Timeout',
|
|
331
|
+
errorMessage: `${errorMessage}. This is usually caused by system resource constraints or competing processes. Try: 1) Kill background processes, 2) Reduce --pool-workers, 3) Increase --test-timeout`,
|
|
332
|
+
sourceLine: ''
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Extract expected/actual values from test output
|
|
337
|
+
*
|
|
338
|
+
* @param output - Full test output
|
|
339
|
+
* @returns Expected and actual values (if found)
|
|
340
|
+
*/
|
|
341
|
+
function extractExpectedActual(fullOutput) {
|
|
342
|
+
const expectedMatch = /- Expected[^\n]*\n[^\n]*\n- (.+)/.exec(fullOutput);
|
|
343
|
+
const actualMatch = /\+ Received[^\n]*\n[^\n]*\n\+ (.+)/.exec(fullOutput);
|
|
344
|
+
return {
|
|
345
|
+
expected: expectedMatch ? expectedMatch[1].trim() : undefined,
|
|
346
|
+
actual: actualMatch ? actualMatch[1].trim() : undefined
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Extract Vitest test failures from output
|
|
351
|
+
*
|
|
352
|
+
* @param output - Raw Vitest/Jest command output
|
|
353
|
+
* @returns Structured error information with test-specific guidance
|
|
354
|
+
*/
|
|
355
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity -- Complexity 29 acceptable for Vitest output parsing (down from 97) - main parsing loop coordinates multiple format detection and state tracking
|
|
356
|
+
function extract(output) {
|
|
357
|
+
const lines = output.split('\n');
|
|
358
|
+
const failures = [];
|
|
359
|
+
let currentFailure = null;
|
|
360
|
+
let currentFile = ''; // Track file from ❯ lines for Format 2
|
|
361
|
+
let hasFormat2 = false; // Track if we found Format 2 file headers
|
|
362
|
+
// First, check for runtime errors (Unhandled Rejection, ENOENT, etc.)
|
|
363
|
+
const runtimeError = extractRuntimeError(output);
|
|
364
|
+
if (runtimeError) {
|
|
365
|
+
failures.push(runtimeError);
|
|
366
|
+
}
|
|
367
|
+
// Check for coverage threshold failures
|
|
368
|
+
const coverageError = extractCoverageThresholdError(output);
|
|
369
|
+
if (coverageError) {
|
|
370
|
+
failures.push(coverageError);
|
|
371
|
+
}
|
|
372
|
+
// Check for Vitest worker timeout errors
|
|
373
|
+
const timeoutError = extractVitestWorkerTimeoutError(output);
|
|
374
|
+
if (timeoutError) {
|
|
375
|
+
failures.push(timeoutError);
|
|
376
|
+
}
|
|
377
|
+
let i = -1;
|
|
378
|
+
while (i < lines.length - 1) {
|
|
379
|
+
i++; // Increment at start so 'continue' statements don't bypass it
|
|
380
|
+
const line = lines[i];
|
|
381
|
+
// Check for Format 2 file header
|
|
382
|
+
const fileHeaderMatch = /❯\s+([^\s]+\.test\.ts)\s+\(/.exec(line);
|
|
383
|
+
if (fileHeaderMatch) {
|
|
384
|
+
currentFile = fileHeaderMatch[1];
|
|
385
|
+
hasFormat2 = true;
|
|
386
|
+
continue;
|
|
387
|
+
}
|
|
388
|
+
// Try to parse as failure line (Format 1 or Format 2)
|
|
389
|
+
const parsedFailure = parseFailureLine(line, currentFile, hasFormat2);
|
|
390
|
+
if (parsedFailure) {
|
|
391
|
+
if (currentFailure?.file) {
|
|
392
|
+
failures.push(currentFailure);
|
|
393
|
+
}
|
|
394
|
+
currentFailure = parsedFailure;
|
|
395
|
+
continue;
|
|
396
|
+
}
|
|
397
|
+
// Parse error message if we have a current failure
|
|
398
|
+
if (currentFailure && !currentFailure.errorMessage) {
|
|
399
|
+
const snapshotMatch = /Snapshot\s+`([^`]+)`\s+mismatched/.exec(line);
|
|
400
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Need to check truthy regex matches, not just null/undefined
|
|
401
|
+
const hasError = /((?:AssertionError|Error):\s*.+)/.exec(line) || /→\s+(.+)/.exec(line) || snapshotMatch;
|
|
402
|
+
if (hasError) {
|
|
403
|
+
const isSnapshotError = !!snapshotMatch;
|
|
404
|
+
const { errorMessage, lastIndex } = parseErrorMessage(lines, i, isSnapshotError);
|
|
405
|
+
currentFailure.errorMessage = errorMessage;
|
|
406
|
+
i = lastIndex;
|
|
407
|
+
}
|
|
408
|
+
continue;
|
|
409
|
+
}
|
|
410
|
+
// Parse location if we have a current failure
|
|
411
|
+
if (currentFailure && !currentFailure.location) {
|
|
412
|
+
const location = parseLocation(line);
|
|
413
|
+
if (location) {
|
|
414
|
+
currentFailure.location = location;
|
|
415
|
+
continue;
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
// Parse source line
|
|
419
|
+
if (currentFailure && /^\s*\d+\|\s+/.exec(line)) {
|
|
420
|
+
const sourceMatch = /^\s*(\d+)\|\s*(.+)/.exec(line);
|
|
421
|
+
if (sourceMatch) {
|
|
422
|
+
currentFailure.sourceLine = `${sourceMatch[1]}| ${sourceMatch[2].trim()}`;
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
// Add last failure
|
|
427
|
+
if (currentFailure?.file) {
|
|
428
|
+
failures.push(currentFailure);
|
|
429
|
+
}
|
|
430
|
+
// Detect timeout failures
|
|
431
|
+
const hasTimeout = failures.some(f => f.errorMessage.includes('Test timed out'));
|
|
432
|
+
// Extract expected/actual values and format output
|
|
433
|
+
const { expected, actual } = extractExpectedActual(output);
|
|
434
|
+
const errorSummary = formatFailuresOutput(failures, expected, actual);
|
|
435
|
+
const guidance = generateGuidanceText(failures.length, expected, actual, hasTimeout);
|
|
436
|
+
const result = {
|
|
437
|
+
errors: failures.slice(0, MAX_ERRORS_IN_ARRAY).map(f => {
|
|
438
|
+
// Parse line:column from end of location string (file paths may contain colons)
|
|
439
|
+
let line;
|
|
440
|
+
let column;
|
|
441
|
+
if (f.location) {
|
|
442
|
+
const parts = f.location.split(':');
|
|
443
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Need to filter empty strings for parseInt, not just null/undefined
|
|
444
|
+
column = Number.parseInt(parts.pop() || '');
|
|
445
|
+
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing -- Need to filter empty strings for parseInt, not just null/undefined
|
|
446
|
+
line = Number.parseInt(parts.pop() || '');
|
|
447
|
+
}
|
|
448
|
+
return {
|
|
449
|
+
file: f.file,
|
|
450
|
+
line: line !== undefined && !Number.isNaN(line) ? line : undefined,
|
|
451
|
+
column: column !== undefined && !Number.isNaN(column) ? column : undefined,
|
|
452
|
+
message: f.errorMessage
|
|
453
|
+
};
|
|
454
|
+
}),
|
|
455
|
+
summary: `${failures.length} test failure(s)`,
|
|
456
|
+
totalErrors: failures.length,
|
|
457
|
+
guidance,
|
|
458
|
+
errorSummary
|
|
459
|
+
};
|
|
460
|
+
return result;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Detect if output is from Vitest or Jest
|
|
464
|
+
*
|
|
465
|
+
* @param output - Command output to analyze
|
|
466
|
+
* @returns Detection result with confidence and patterns
|
|
467
|
+
*/
|
|
468
|
+
function detect(output) {
|
|
469
|
+
// Look for Vitest-specific markers
|
|
470
|
+
const vitestMarkers = [
|
|
471
|
+
/FAIL\s+\S+\.test\.(ts|js)/, // FAIL test-file.test.ts
|
|
472
|
+
/❯\s+\S+\.test\.(ts|js)/, // ❯ test-file.test.ts
|
|
473
|
+
/×\s+[^❯]+/, // × test name (without file marker)
|
|
474
|
+
// eslint-disable-next-line sonarjs/slow-regex -- Safe: only parses Vitest test framework output (controlled output), limited input size
|
|
475
|
+
/⎯+\s*Unhandled/, // Unhandled errors section
|
|
476
|
+
];
|
|
477
|
+
const patterns = [];
|
|
478
|
+
let matchCount = 0;
|
|
479
|
+
for (const marker of vitestMarkers) {
|
|
480
|
+
if (marker.test(output)) {
|
|
481
|
+
matchCount++;
|
|
482
|
+
patterns.push(marker.source);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
if (matchCount >= 2) {
|
|
486
|
+
return {
|
|
487
|
+
confidence: 90,
|
|
488
|
+
patterns,
|
|
489
|
+
reason: 'Multiple Vitest/Jest test failure patterns detected',
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
if (matchCount === 1) {
|
|
493
|
+
return {
|
|
494
|
+
confidence: 70,
|
|
495
|
+
patterns,
|
|
496
|
+
reason: 'Single Vitest/Jest test failure pattern detected',
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
return { confidence: 0, patterns: [], reason: '' };
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Sample test cases for Vitest extractor
|
|
503
|
+
*/
|
|
504
|
+
const samples = [
|
|
505
|
+
{
|
|
506
|
+
name: 'single-test-failure',
|
|
507
|
+
description: 'Single Vitest test failure with assertion error',
|
|
508
|
+
input: `FAIL test/unit/config/environment.test.ts > EnvironmentConfig > should parse HTTP_PORT
|
|
509
|
+
AssertionError: expected 3000 to be 9999 // Object.is equality
|
|
510
|
+
❯ test/unit/config/environment.test.ts:57:30
|
|
511
|
+
57| expect(config.HTTP_PORT).toBe(9999);`,
|
|
512
|
+
expectedErrors: 1,
|
|
513
|
+
expectedPatterns: ['FAIL', 'AssertionError', '❯'],
|
|
514
|
+
},
|
|
515
|
+
{
|
|
516
|
+
name: 'multiple-test-failures',
|
|
517
|
+
description: 'Multiple Vitest test failures across different files',
|
|
518
|
+
input: `FAIL test/unit/config/environment.test.ts > EnvironmentConfig > test 1
|
|
519
|
+
AssertionError: expected 3000 to be 9999
|
|
520
|
+
❯ test/unit/config/environment.test.ts:57:30
|
|
521
|
+
|
|
522
|
+
FAIL test/unit/auth/factory.test.ts > AuthFactory > test 2
|
|
523
|
+
Error: Cannot create auth provider
|
|
524
|
+
❯ test/unit/auth/factory.test.ts:100:15`,
|
|
525
|
+
expectedErrors: 2,
|
|
526
|
+
expectedPatterns: ['FAIL', 'AssertionError', 'Error'],
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
name: 'coverage-threshold-failure',
|
|
530
|
+
description: 'Coverage threshold not met',
|
|
531
|
+
input: `Test Files 1139 passed (1139)
|
|
532
|
+
Tests 1139 passed (1139)
|
|
533
|
+
|
|
534
|
+
ERROR: Coverage for functions (86.47%) does not meet global threshold (87%)`,
|
|
535
|
+
expectedErrors: 1,
|
|
536
|
+
expectedPatterns: ['Coverage', 'threshold'],
|
|
537
|
+
},
|
|
538
|
+
];
|
|
539
|
+
/**
|
|
540
|
+
* Vitest/Jest Error Extractor Plugin
|
|
541
|
+
*
|
|
542
|
+
* Extracts Vitest and Jest test failures with high confidence (90%).
|
|
543
|
+
* Supports multiple output formats and special error types (runtime, coverage, worker timeouts).
|
|
544
|
+
*/
|
|
545
|
+
const vitestPlugin = {
|
|
546
|
+
metadata: {
|
|
547
|
+
name: 'vitest',
|
|
548
|
+
version: '1.0.0',
|
|
549
|
+
author: 'vibe-validate',
|
|
550
|
+
description: 'Extracts Vitest and Jest test failures',
|
|
551
|
+
repository: 'https://github.com/jdutton/vibe-validate',
|
|
552
|
+
tags: ['vitest', 'jest', 'testing', 'test-failures'],
|
|
553
|
+
},
|
|
554
|
+
hints: {
|
|
555
|
+
required: [],
|
|
556
|
+
anyOf: ['FAIL', 'test.ts', 'test.js', '❯', '×'],
|
|
557
|
+
},
|
|
558
|
+
priority: 85,
|
|
559
|
+
detect,
|
|
560
|
+
extract,
|
|
561
|
+
samples,
|
|
562
|
+
};
|
|
563
|
+
export default vitestPlugin;
|
|
564
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/extractors/vitest/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAU7D;;;;;;;;;GASG;AACH,SAAS,gBAAgB,CACvB,IAAY,EACZ,WAAmB,EACnB,UAAmB;IAEnB,qDAAqD;IACrD,sFAAsF;IACtF,MAAM,YAAY,GAAG,CAAC,UAAU,IAAI,8CAA8C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9F,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO;YACL,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;YACrB,aAAa,EAA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AA4B;QAClC,WAAW,EAAE,4BAA4B;QACzC,KAAK,EAAE;;;4EAGiE;QACxE,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,CAAC,UAAU,EAAE,WAAW,CAAC;KAC5C;CACF,CAAC;AAEF;;;;;GAKG;AACH,MAAM,YAAY,GAAoB;IACpC,QAAQ,EAAE;QACR,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,OAAO;QAChB,MAAM,EAAE,eAAe;QACvB,WAAW,EAAE,wCAAwC;QACrD,UAAU,EAAE,0CAA0C;QACtD,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,CAAC;KACrD;IACD,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE;QACZ,KAAK,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,CAAC;KAChD;IACD,QAAQ,EAAE,EAAE;IACZ,MAAM;IACN,OAAO;IACP,OAAO;CACR,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../src/extractors/vitest/index.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|