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

Function TestAPI_Projects

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

Source from the content-addressed store, hash-verified

242}
243
244func TestAPI_Projects(t *testing.T) {
245 mux, _ := setupAPI(t)
246
247 r := httptest.NewRequest("GET", "/api/projects", nil)
248 w := httptest.NewRecorder()
249 mux.ServeHTTP(w, r)
250
251 var resp map[string]any
252 json.NewDecoder(w.Body).Decode(&resp)
253 data := resp["data"].([]any)
254 if len(data) != 1 {
255 t.Errorf("len = %d, want 1 (default project)", len(data))
256 }
257 proj := data[0].(map[string]any)
258 if proj["key"] != "default" {
259 t.Errorf("key = %v", proj["key"])
260 }
261}

Callers

nothing calls this directly

Calls 2

setupAPIFunction · 0.85
ServeHTTPMethod · 0.80

Tested by

no test coverage detected