Files
CosmicClash/server/cmd/control-plane/main_test.go
T
2026-09-01 09:24:05 +01:00

17 lines
346 B
Go

package main
import (
"net/http"
"net/http/httptest"
"testing"
)
func TestAPIHandlerExposesHealthWithoutDatabase(t *testing.T) {
req := httptest.NewRequest(http.MethodGet, "/healthz", nil)
rec := httptest.NewRecorder()
newAPIHandler(nil).ServeHTTP(rec, req)
if rec.Code != http.StatusOK {
t.Fatalf("health status = %d", rec.Code)
}
}