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

Function simulatePostWrite

test/tdd_harness.test.js:27–38  ·  view source on GitHub ↗
(state, gov, filePath, testResult)

Source from the content-addressed store, hash-verified

25// Simulate what _tddPostWrite does, but with injected test results
26// so we don't actually run a test suite.
27function simulatePostWrite(state, gov, filePath, testResult) {
28 const { _isTestFile } = require('../src/session/tdd_state');
29 const isTestFile = _isTestFile(filePath || '');
30
31 // Auto-begin cycle if idle + test file + failures
32 if (state.isIdle() && isTestFile && (testResult.failed > 0 || testResult.errors > 0)) {
33 const inferredName = (testResult.failures[0] && testResult.failures[0].name) || 'new test';
34 state.beginCycle(inferredName);
35 }
36
37 return gov.processTestResult(testResult);
38}
39
40// ─── Auto-begin cycle ─────────────────────────────────────────────────────────
41

Callers 1

Calls 4

_isTestFileFunction · 0.85
isIdleMethod · 0.80
beginCycleMethod · 0.80
processTestResultMethod · 0.80

Tested by

no test coverage detected