(t *testing.T)
| 26 | } |
| 27 | |
| 28 | func TestContextHandlerSkipsEmptyContext(t *testing.T) { |
| 29 | var buf bytes.Buffer |
| 30 | logger := slog.New(NewContextHandler(slog.NewTextHandler(&buf, nil))) |
| 31 | |
| 32 | logger.InfoContext(context.Background(), "migration started") |
| 33 | |
| 34 | output := buf.String() |
| 35 | require.Contains(t, output, `msg="migration started"`) |
| 36 | require.NotContains(t, output, `project=`) |
| 37 | require.NotContains(t, output, `task_run_id=`) |
| 38 | } |
nothing calls this directly
no test coverage detected