WithMockClient is a test helper that allows you to inject a mock client for testing. By default, it mocks the "/_ping" endpoint, so allow the client to perform API-version negotiation. Other endpoints are handled by "doer".
(doer func(*http.Request) (*http.Response, error))
| 117 | // testing. By default, it mocks the "/_ping" endpoint, so allow the client |
| 118 | // to perform API-version negotiation. Other endpoints are handled by "doer". |
| 119 | func WithMockClient(doer func(*http.Request) (*http.Response, error)) Opt { |
| 120 | return WithHTTPClient(&http.Client{ |
| 121 | Transport: makeTestRoundTripper(doer), |
| 122 | }) |
| 123 | } |
| 124 | |
| 125 | // WithBaseMockClient is a test helper that allows you to inject a mock client |
| 126 | // for testing. It is identical to [WithMockClient], but does not mock the "/_ping" |
no test coverage detected
searching dependent graphs…