(t *testing.T)
| 156 | } |
| 157 | |
| 158 | func TestIntegration_MonitorGet_JSONOutput(t *testing.T) { |
| 159 | mock := testutil.NewMockAPI() |
| 160 | defer mock.Close() |
| 161 | |
| 162 | fixture := testutil.LoadFixture("monitor_get.json") |
| 163 | mock.On("GET", "/monitors/my-job", 200, fixture) |
| 164 | |
| 165 | cleanup := setupIntegrationTest(mock.Server.URL) |
| 166 | defer cleanup() |
| 167 | |
| 168 | monitorFormat = "" |
| 169 | monitorOutput = "" |
| 170 | |
| 171 | output, err := executeCmd("monitor", "get", "my-job") |
| 172 | if err != nil { |
| 173 | t.Fatalf("unexpected error: %v", err) |
| 174 | } |
| 175 | |
| 176 | trimmed := strings.TrimSpace(output) |
| 177 | if !json.Valid([]byte(trimmed)) { |
| 178 | t.Errorf("expected valid pretty-printed JSON output, got:\n%s", output) |
| 179 | } |
| 180 | |
| 181 | // Should be indented (pretty-printed) |
| 182 | if !strings.Contains(trimmed, "\n") { |
| 183 | t.Error("expected pretty-printed JSON (multi-line)") |
| 184 | } |
| 185 | } |
| 186 | |
| 187 | // --- Step 9: YAML Output Test --- |
| 188 |
nothing calls this directly
no test coverage detected