(t *testing.T)
| 75 | } |
| 76 | |
| 77 | func TestPRList(t *testing.T) { |
| 78 | http := initFakeHTTP() |
| 79 | defer http.Verify(t) |
| 80 | |
| 81 | http.Register(httpmock.GraphQL(`query PullRequestList\b`), httpmock.FileResponse("./fixtures/prList.json")) |
| 82 | |
| 83 | output, err := runCommand(http, nil, true, "") |
| 84 | if err != nil { |
| 85 | t.Fatal(err) |
| 86 | } |
| 87 | |
| 88 | assert.Equal(t, heredoc.Doc(` |
| 89 | |
| 90 | Showing 3 of 3 open pull requests in OWNER/REPO |
| 91 | |
| 92 | ID TITLE BRANCH CREATED AT |
| 93 | #32 New feature feature about 3 hours ago |
| 94 | #29 Fixed bad bug hubot:bug-fix about 1 month ago |
| 95 | #28 Improve documentation docs about 2 years ago |
| 96 | `), output.String()) |
| 97 | assert.Equal(t, ``, output.Stderr()) |
| 98 | } |
| 99 | |
| 100 | func TestPRList_nontty(t *testing.T) { |
| 101 | http := initFakeHTTP() |
nothing calls this directly
no test coverage detected