MCPcopy
hub / github.com/Doorman11991/smallcode / formatResult

Function formatResult

src/tools/run_tests.js:395–417  ·  view source on GitHub ↗
(r)

Source from the content-addressed store, hash-verified

393// Formats structured result as the tool's text output (the string the model sees).
394
395function formatResult(r) {
396 if (!r.command) return r.raw || 'No test runner found.';
397
398 const lines = [];
399 lines.push(`run_tests (${r.framework}): ${r.summary} [${Math.round(r.durationMs / 100) / 10}s]`);
400 lines.push(`command: ${r.command}`);
401
402 if (r.failures.length > 0) {
403 lines.push('');
404 lines.push('Failures:');
405 for (const f of r.failures) {
406 lines.push(` ✗ ${f.name}${f.message ? ': ' + f.message : ''}`);
407 }
408 }
409
410 if (r.raw) {
411 lines.push('');
412 lines.push('--- raw output ---');
413 lines.push(r.raw);
414 }
415
416 return lines.join('\n');
417}
418
419module.exports = {
420 runTests,

Callers 2

_executeToolMethod · 0.85
executeToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected