template-monorepo/test/e2e/health_test.go

26 lines
562 B
Go
Raw Normal View History

2026-05-21 23:52:39 +00:00
//go:build e2e
package e2e
import (
"encoding/json"
"net/http"
"testing"
"github.com/stretchr/testify/require"
)
func TestHealth_Ping(t *testing.T) {
c := NewClient(t)
env := c.DoExpectOK(t, http.MethodGet, "/api/v1/health", nil, false)
var data map[string]any
require.NoError(t, json.Unmarshal(env.Data, &data))
}
func TestHealth_NoAuthRequired(t *testing.T) {
c := NewClient(t)
resp, env := c.Do(t, http.MethodGet, "/api/v1/health", nil, false)
require.Equal(t, http.StatusOK, resp.StatusCode)
require.Equal(t, int64(successCode), env.Code)
}