(t *testing.T)
| 315 | } |
| 316 | |
| 317 | func TestNewServiceLogModeWithColorLogsToWriter(t *testing.T) { |
| 318 | // Given an invocation with colored log delivery |
| 319 | t.Cleanup(stubDeviceID("test-device")) |
| 320 | var buf bytes.Buffer |
| 321 | service := NewService(LogFlusher(&buf, true)) |
| 322 | |
| 323 | // When the invocation finishes |
| 324 | service.Record(ghtelemetry.Event{Type: "color_event"}) |
| 325 | service.Finish() |
| 326 | |
| 327 | // Then the writer receives the event with ANSI color codes |
| 328 | output := buf.String() |
| 329 | assert.Contains(t, output, "color_event") |
| 330 | assert.Contains(t, output, "\033[", "expected ANSI escape sequences when color is enabled") |
| 331 | } |
| 332 | |
| 333 | func TestLogFlusherWritesNoneMarkerForEmptyPayload(t *testing.T) { |
| 334 | t.Run("no color", func(t *testing.T) { |
nothing calls this directly
no test coverage detected