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

Function TestAPIExceptionsGrouped

modules/sentry/api_test.go:113–138  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

111}
112
113func TestAPIExceptionsGrouped(t *testing.T) {
114 mux := http.NewServeMux()
115 seedTestData(t, mux)
116
117 req := httptest.NewRequest("GET", "/api/sentry/exceptions?grouped=true", nil)
118 w := httptest.NewRecorder()
119 mux.ServeHTTP(w, req)
120
121 if w.Code != 200 {
122 t.Fatalf("status = %d, want 200", w.Code)
123 }
124
125 var resp map[string]any
126 json.Unmarshal(w.Body.Bytes(), &resp)
127
128 data := resp["data"].([]any)
129 if len(data) != 2 {
130 t.Fatalf("data length = %d, want 2 (2 distinct fingerprints)", len(data))
131 }
132
133 // First group should have count 2 (RuntimeException).
134 first := data[0].(map[string]any)
135 if int(first["count"].(float64)) != 2 {
136 t.Errorf("first group count = %v, want 2", first["count"])
137 }
138}
139
140func TestAPIExceptionsFilterLevel(t *testing.T) {
141 mux := http.NewServeMux()

Callers

nothing calls this directly

Calls 2

seedTestDataFunction · 0.85
ServeHTTPMethod · 0.80

Tested by

no test coverage detected