MCPcopy
hub / github.com/cli/cli / TestPRList

Function TestPRList

pkg/cmd/pr/list/list_test.go:77–98  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func 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
100func TestPRList_nontty(t *testing.T) {
101 http := initFakeHTTP()

Callers

nothing calls this directly

Calls 9

GraphQLFunction · 0.92
FileResponseFunction · 0.92
EqualMethod · 0.80
StderrMethod · 0.80
initFakeHTTPFunction · 0.70
runCommandFunction · 0.70
VerifyMethod · 0.65
RegisterMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected