(t *testing.T, ch <-chan *httptest.ResponseRecorder, msg string)
| 63 | } |
| 64 | |
| 65 | func waitForRecorder(t *testing.T, ch <-chan *httptest.ResponseRecorder, msg string) *httptest.ResponseRecorder { |
| 66 | t.Helper() |
| 67 | select { |
| 68 | case rec := <-ch: |
| 69 | return rec |
| 70 | case <-time.After(2 * time.Second): |
| 71 | t.Fatal(msg) |
| 72 | return nil |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | // captureSlog redirects slog.Default to a buffer for the duration of a test |
| 77 | // and returns the buffer + a restore function. Used by the forward-uncached |
no outgoing calls
no test coverage detected