(t *testing.T)
| 45 | } |
| 46 | |
| 47 | func TestGraphQLError(t *testing.T) { |
| 48 | reg := &httpmock.Registry{} |
| 49 | client := newTestClient(reg) |
| 50 | |
| 51 | response := struct{}{} |
| 52 | |
| 53 | reg.Register( |
| 54 | httpmock.GraphQL(""), |
| 55 | httpmock.StringResponse(` |
| 56 | { "errors": [ |
| 57 | { |
| 58 | "type": "NOT_FOUND", |
| 59 | "message": "OH NO", |
| 60 | "path": ["repository", "issue"] |
| 61 | }, |
| 62 | { |
| 63 | "type": "ACTUALLY_ITS_FINE", |
| 64 | "message": "this is fine", |
| 65 | "path": ["repository", "issues", 0, "comments"] |
| 66 | } |
| 67 | ] |
| 68 | } |
| 69 | `), |
| 70 | ) |
| 71 | |
| 72 | err := client.GraphQL("github.com", "", nil, &response) |
| 73 | if err == nil || err.Error() != "GraphQL: OH NO (repository.issue), this is fine (repository.issues.0.comments)" { |
| 74 | t.Fatalf("got %q", err.Error()) |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | func TestRESTGetDelete(t *testing.T) { |
| 79 | http := &httpmock.Registry{} |
nothing calls this directly
no test coverage detected