(t *testing.T)
| 378 | } |
| 379 | |
| 380 | func TestGraphQLWithHeader(t *testing.T) { |
| 381 | reg := &httpmock.Registry{} |
| 382 | defer reg.Verify(t) |
| 383 | client := newTestClient(reg) |
| 384 | |
| 385 | reg.Register(httpmock.MatchAny, httpmock.StatusStringResponse(200, `{"data": {}}`)) |
| 386 | |
| 387 | var response struct{} |
| 388 | err := client.GraphQL("github.com", "query{}", nil, &response, |
| 389 | WithHeader("Authorization", "token explicit-token")) |
| 390 | require.NoError(t, err) |
| 391 | |
| 392 | assert.Equal(t, "token explicit-token", reg.Requests[0].Header.Get("Authorization")) |
| 393 | } |
| 394 | |
| 395 | // TestDoRequestPreservesCheckRedirect pins the difference between Request and DoRequest that |
| 396 | // motivates DoRequest existing for redirect-sensitive call sites. Request delegates to go-gh, |
nothing calls this directly
no test coverage detected