Updated GitHub Actions workflow for Go tests and coverage
This commit is contained in:
23
NewProxy/routes/status_test.go
Normal file
23
NewProxy/routes/status_test.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package routes
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func TestStatusHandler(t *testing.T) {
|
||||
gin.SetMode(gin.TestMode)
|
||||
r := gin.Default()
|
||||
RegisterStatusRoute(r)
|
||||
|
||||
req, _ := http.NewRequest("GET", "/status", nil)
|
||||
w := httptest.NewRecorder()
|
||||
r.ServeHTTP(w, req)
|
||||
|
||||
if w.Code != http.StatusOK {
|
||||
t.Errorf("Expected 200 OK, got %d", w.Code)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user