MCPcopy Create free account
hub / github.com/github/gh-aw / TestParseReactionConfigMap

Function TestParseReactionConfigMap

pkg/workflow/reactions_test.go:178–200  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

176}
177
178func TestParseReactionConfigMap(t *testing.T) {
179 reaction, issues, pullRequests, discussions, err := parseReactionConfig(map[string]any{
180 "type": "rocket",
181 "issues": false,
182 "pull-requests": true,
183 "discussions": false,
184 })
185 if err != nil {
186 t.Errorf("parseReactionConfig(map) returned unexpected error: %v", err)
187 }
188 if reaction != "rocket" {
189 t.Errorf("Expected reaction type 'rocket', got %q", reaction)
190 }
191 if issues == nil || *issues {
192 t.Errorf("Expected issues target false, got %v", issues)
193 }
194 if pullRequests == nil || !*pullRequests {
195 t.Errorf("Expected pull-requests target true, got %v", pullRequests)
196 }
197 if discussions == nil || *discussions {
198 t.Errorf("Expected discussions target false, got %v", discussions)
199 }
200}
201
202func TestParseReactionConfigMapAllTargetsDisabled(t *testing.T) {
203 _, _, _, _, err := parseReactionConfig(map[string]any{

Callers

nothing calls this directly

Calls 2

parseReactionConfigFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected