fix(test): update executor test fixture to match --output-format json envelope

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-04-19 07:42:24 +02:00
parent 6169404f34
commit e14141f64c

View File

@@ -28,8 +28,10 @@ func fakeClaudePath(t *testing.T, output string, exitCode int) string {
} }
func TestExecutorParsesValidResult(t *testing.T) { func TestExecutorParsesValidResult(t *testing.T) {
validJSON := `{"status":"pass","phase":"red","skill":"tdd","file_path":"/tmp/x_test.go","runner_output":"FAIL","verified":true,"model_used":"self","message":"ok"}` // Fake claude emits the --output-format json envelope that the real CLI produces.
claude := fakeClaudePath(t, validJSON, 0) // The executor extracts the result from the "structured_output" field.
envelope := `{"type":"result","subtype":"success","is_error":false,"structured_output":{"status":"pass","phase":"red","skill":"tdd","file_path":"/tmp/x_test.go","runner_output":"FAIL","verified":true,"model_used":"self","message":"ok"}}`
claude := fakeClaudePath(t, envelope, 0)
ex := iexec.New(iexec.Config{ ex := iexec.New(iexec.Config{
ClaudeBinary: claude, ClaudeBinary: claude,