Updated GitHub Actions workflow for Go tests and coverage

This commit is contained in:
Andrei Alexandru
2025-11-02 12:01:20 +02:00
parent b8a4d8d8da
commit df9a134e9b
6 changed files with 55 additions and 55 deletions

View File

@@ -0,0 +1,23 @@
package routes
import (
"net/http"
"net/http/httptest"
"testing"
"github.com/gin-gonic/gin"
)
func TestBuildsHandler(t *testing.T) {
gin.SetMode(gin.TestMode)
r := gin.Default()
RegisterBuildsRoute(r)
req, _ := http.NewRequest("GET", "/client/builds.json", nil)
w := httptest.NewRecorder()
r.ServeHTTP(w, req)
if w.Code != http.StatusOK {
t.Errorf("Expected 200 OK, got %d", w.Code)
}
}