MCPcopy Create free account
hub / github.com/go-playground/webhooks / TestWebhooks

Function TestWebhooks

github/github_test.go:127–601  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

125}
126
127func TestWebhooks(t *testing.T) {
128 tests := []struct {
129 name string
130 event Event
131 typ interface{}
132 filename string
133 headers http.Header
134 }{
135 {
136 name: "CheckRunEvent",
137 event: CheckRunEvent,
138 typ: CheckRunPayload{},
139 filename: "../testdata/github/check-run.json",
140 headers: http.Header{
141 "X-Github-Event": []string{"check_run"},
142 },
143 },
144 {
145 name: "CheckSuiteEvent",
146 event: CheckSuiteEvent,
147 typ: CheckSuitePayload{},
148 filename: "../testdata/github/check-suite.json",
149 headers: http.Header{
150 "X-Github-Event": []string{"check_suite"},
151 },
152 },
153 {
154 name: "CommitCommentEvent",
155 event: CommitCommentEvent,
156 typ: CommitCommentPayload{},
157 filename: "../testdata/github/commit-comment.json",
158 headers: http.Header{
159 "X-Github-Event": []string{"commit_comment"},
160 },
161 },
162 {
163 name: "CreateEvent",
164 event: CreateEvent,
165 typ: CreatePayload{},
166 filename: "../testdata/github/create.json",
167 headers: http.Header{
168 "X-Github-Event": []string{"create"},
169 },
170 },
171 {
172 name: "DeleteEvent",
173 event: DeleteEvent,
174 typ: DeletePayload{},
175 filename: "../testdata/github/delete.json",
176 headers: http.Header{
177 "X-Github-Event": []string{"delete"},
178 },
179 },
180 {
181 name: "DependabotAlertEvent",
182 event: DependabotAlertEvent,
183 typ: DependabotAlertPayload{},
184 filename: "../testdata/github/dependabot_alert.json",

Callers

nothing calls this directly

Calls 2

newServerFunction · 0.70
ParseMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…