(t *testing.T)
| 337 | } |
| 338 | |
| 339 | func TestNewServiceLogModeWithColorLogsToWriter(t *testing.T) { |
| 340 | t.Cleanup(stubDeviceID("test-device")) |
| 341 | |
| 342 | var buf bytes.Buffer |
| 343 | svc := NewService(LogFlusher(&buf, true)) |
| 344 | |
| 345 | svc.Record(ghtelemetry.Event{Type: "color_event"}) |
| 346 | svc.Flush() |
| 347 | |
| 348 | output := buf.String() |
| 349 | assert.Contains(t, output, "color_event") |
| 350 | // Verify ANSI color codes are present in the output |
| 351 | assert.Contains(t, output, "\033[", "expected ANSI escape sequences when color is enabled") |
| 352 | } |
| 353 | |
| 354 | func TestLogFlusherWritesNoneMarkerForEmptyPayload(t *testing.T) { |
| 355 | t.Run("no color", func(t *testing.T) { |
nothing calls this directly
no test coverage detected