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

Function TestAPIEmptyDatabase

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

Source from the content-addressed store, hash-verified

438}
439
440func TestAPIEmptyDatabase(t *testing.T) {
441 db := setupTestDB(t)
442 mux := http.NewServeMux()
443 registerAPI(mux, db)
444
445 endpoints := []string{
446 "/api/sentry/exceptions",
447 "/api/sentry/exceptions?grouped=true",
448 "/api/sentry/traces",
449 "/api/sentry/logs",
450 "/api/sentry/service-map",
451 "/api/sentry/counts",
452 }
453
454 for _, ep := range endpoints {
455 t.Run(ep, func(t *testing.T) {
456 req := httptest.NewRequest("GET", ep, nil)
457 w := httptest.NewRecorder()
458 mux.ServeHTTP(w, req)
459
460 if w.Code != 200 {
461 t.Fatalf("status = %d, want 200 for %s", w.Code, ep)
462 }
463 })
464 }
465}

Callers

nothing calls this directly

Calls 4

ServeHTTPMethod · 0.80
setupTestDBFunction · 0.70
registerAPIFunction · 0.70
RunMethod · 0.45

Tested by

no test coverage detected