MCPcopy Create free account
hub / github.com/cli/cli / mockCommentCreate

Function mockCommentCreate

pkg/cmd/issue/comment/comment_test.go:861–873  ·  view source on GitHub ↗
(t *testing.T, reg *httpmock.Registry)

Source from the content-addressed store, hash-verified

859}
860
861func mockCommentCreate(t *testing.T, reg *httpmock.Registry) {
862 reg.Register(
863 httpmock.GraphQL(`mutation CommentCreate\b`),
864 httpmock.GraphQLMutation(`
865 { "data": { "addComment": { "commentEdge": { "node": {
866 "url": "https://github.com/OWNER/REPO/issues/123#issuecomment-456"
867 } } } } }`,
868 func(inputs map[string]any) {
869 assert.Equal(t, "ISSUE-ID", inputs["subjectId"])
870 assert.Equal(t, "comment body", inputs["body"])
871 }),
872 )
873}
874
875func mockCommentUpdate(t *testing.T, reg *httpmock.Registry) {
876 reg.Register(

Callers 1

Test_commentRunFunction · 0.70

Calls 4

GraphQLFunction · 0.92
GraphQLMutationFunction · 0.92
EqualMethod · 0.80
RegisterMethod · 0.45

Tested by

no test coverage detected