(output, exitCode)
| 268 | } |
| 269 | |
| 270 | function parseGeneric(output, exitCode) { |
| 271 | // Last-resort heuristic: look for common pass/fail keywords |
| 272 | const result = { passed: 0, failed: 0, errors: 0, skipped: 0, failures: [] }; |
| 273 | |
| 274 | const passingM = output.match(/(\d+)\s+(?:tests?\s+)?(?:passed|passing|ok)\b/i); |
| 275 | if (passingM) result.passed = parseInt(passingM[1], 10); |
| 276 | |
| 277 | const failingM = output.match(/(\d+)\s+(?:tests?\s+)?(?:failed|failing)\b/i); |
| 278 | if (failingM) result.failed = parseInt(failingM[1], 10); |
| 279 | |
| 280 | // Heuristic: if exit code is non-zero and we couldn't detect failures, mark 1 |
| 281 | if (exitCode !== 0 && result.failed === 0 && result.errors === 0) { |
| 282 | result.failed = 1; |
| 283 | result.failures.push({ name: '(unknown)', message: output.split('\n').filter(l => l.trim()).slice(-3).join(' ').slice(0, 200) }); |
| 284 | } |
| 285 | |
| 286 | return result; |
| 287 | } |
| 288 | |
| 289 | function parseOutput(framework, output, exitCode) { |
| 290 | switch (framework) { |
no outgoing calls
no test coverage detected