searchResp builds a mock search JSON response.
(hasNext bool, endCursor string, count int, nodes string)
| 89 | |
| 90 | // searchResp builds a mock search JSON response. |
| 91 | func searchResp(hasNext bool, endCursor string, count int, nodes string) string { |
| 92 | return heredoc.Docf(` |
| 93 | { |
| 94 | "data": { |
| 95 | "search": { |
| 96 | "discussionCount": %d, |
| 97 | "pageInfo": { |
| 98 | "hasNextPage": %t, |
| 99 | "endCursor": %q |
| 100 | }, |
| 101 | "nodes": [%s] |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | `, count, hasNext, endCursor, nodes) |
| 106 | } |
| 107 | |
| 108 | func TestList(t *testing.T) { |
| 109 | repo := ghrepo.New("OWNER", "REPO") |