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

Function TestAPI_Events_Empty

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

Source from the content-addressed store, hash-verified

84}
85
86func TestAPI_Events_Empty(t *testing.T) {
87 mux, _ := setupAPI(t)
88
89 r := httptest.NewRequest("GET", "/api/events", nil)
90 w := httptest.NewRecorder()
91 mux.ServeHTTP(w, r)
92
93 var resp map[string]any
94 json.NewDecoder(w.Body).Decode(&resp)
95 data, ok := resp["data"].([]any)
96 if !ok {
97 t.Fatal("data is not array")
98 }
99 if len(data) != 0 {
100 t.Errorf("len = %d, want 0", len(data))
101 }
102}
103
104func TestAPI_Events_CRUD(t *testing.T) {
105 mux, store := setupAPI(t)

Callers

nothing calls this directly

Calls 2

setupAPIFunction · 0.85
ServeHTTPMethod · 0.80

Tested by

no test coverage detected