You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
497 B
Go
24 lines
497 B
Go
package metrics
|
|
|
|
// http_test.go contains backend tests for package behavior, error paths, and regressions.
|
|
|
|
import (
|
|
"net/http"
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// TestHandler ensures handler behavior is handled correctly.
|
|
func TestHandler(t *testing.T) {
|
|
h := Handler()
|
|
require.NotNil(t, h)
|
|
|
|
req := httptest.NewRequest(http.MethodGet, "/metrics", nil)
|
|
rr := httptest.NewRecorder()
|
|
|
|
h.ServeHTTP(rr, req)
|
|
require.Equal(t, http.StatusOK, rr.Code)
|
|
}
|