(t *testing.T)
| 192 | } |
| 193 | |
| 194 | func TestMaxIterationsAutoApproveJSONMode(t *testing.T) { |
| 195 | t.Parallel() |
| 196 | |
| 197 | rt := &mockRuntime{ |
| 198 | events: []runtime.Event{maxIterEvent(60)}, |
| 199 | } |
| 200 | |
| 201 | var buf bytes.Buffer |
| 202 | out := NewPrinter(&buf) |
| 203 | sess := session.New() |
| 204 | cfg := Config{AutoApprove: true, OutputJSON: true} |
| 205 | |
| 206 | err := Run(t.Context(), out, cfg, rt, sess, []string{"hello"}) |
| 207 | assert.NilError(t, err) |
| 208 | |
| 209 | resumes := rt.getResumes() |
| 210 | assert.Equal(t, len(resumes), 1) |
| 211 | assert.Equal(t, resumes[0].Type, runtime.ResumeTypeApprove) |
| 212 | } |
| 213 | |
| 214 | func TestMaxIterationsRejectInJSONModeWithoutYolo(t *testing.T) { |
| 215 | t.Parallel() |
nothing calls this directly
no test coverage detected