[#1233] added health API endpoint

This commit is contained in:
Marvin Wendt
2022-12-11 16:27:46 +01:00
committed by GitHub
parent 506bfca8b2
commit 5c899a4cf0
3 changed files with 54 additions and 0 deletions

25
apis/health_test.go Normal file
View File

@@ -0,0 +1,25 @@
package apis_test
import (
"github.com/pocketbase/pocketbase/tests"
"net/http"
"testing"
)
func TestHealthAPI(t *testing.T) {
scenarios := []tests.ApiScenario{
{
Name: "health status returns 200",
Method: http.MethodGet,
Url: "/api/health",
ExpectedStatus: 200,
ExpectedContent: []string{
`"code":200`,
},
},
}
for _, scenario := range scenarios {
scenario.Test(t)
}
}