package services import ( "health-go/routers" "net/http" "net/http/httptest" "testing" "github.com/stretchr/testify/assert" ) func TestPingRoute(t *testing.T) { router := routers.SetupRouter() w := httptest.NewRecorder() req, _ := http.NewRequest("GET", "/fetchHosList", nil) router.ServeHTTP(w, req) assert.JSONEq(t, `{"code: 20"}`, w.Body.String()) }