mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 19:13:43 +00:00
17 lines
346 B
Go
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)
|
|
}
|
|
}
|