MCPcopy Create free account
hub / github.com/buggregator/server / TestAPI_Settings

Function TestAPI_Settings

internal/server/http/api_test.go:68–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

66}
67
68func TestAPI_Settings(t *testing.T) {
69 mux, _ := setupAPI(t)
70
71 r := httptest.NewRequest("GET", "/api/settings", nil)
72 w := httptest.NewRecorder()
73 mux.ServeHTTP(w, r)
74
75 var resp map[string]any
76 json.NewDecoder(w.Body).Decode(&resp)
77 if resp["version"] != "test-version" {
78 t.Errorf("version = %q", resp["version"])
79 }
80 events, ok := resp["events"].([]any)
81 if !ok || len(events) != 2 {
82 t.Errorf("events = %v", resp["events"])
83 }
84}
85
86func TestAPI_Events_Empty(t *testing.T) {
87 mux, _ := setupAPI(t)

Callers

nothing calls this directly

Calls 2

setupAPIFunction · 0.85
ServeHTTPMethod · 0.80

Tested by

no test coverage detected