pocketbase/apis/health_test.go

29 lines
477 B
Go
Raw Normal View History

2022-12-11 23:27:46 +08:00
package apis_test
import (
"net/http"
"testing"
2022-12-16 23:06:03 +08:00
"github.com/pocketbase/pocketbase/tests"
2022-12-11 23:27:46 +08:00
)
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`,
2023-05-14 03:10:14 +08:00
`"data":{`,
`"canBackup":true`,
2022-12-11 23:27:46 +08:00
},
},
}
for _, scenario := range scenarios {
scenario.Test(t)
}
}