Documentation
¶
Overview ¶
Package hxtest provides a fluent API for testing hx.HandlerFunc.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶
Check is a test check applied to a Result.
func ProblemDetail ¶
func ProblemTitle ¶
type Result ¶
type Result struct {
ContentType string
Status int
Header http.Header
Body any
Hijacked bool
Err error
Problem *out.ProblemDetails
}
Result is a materialized HTTP response produced by running a handler.
type Tester ¶
type Tester struct {
// contains filtered or unexported fields
}
Tester is the harness builder. Create via Test(t, handler).
func Test ¶
func Test(t testing.TB, h hx.HandlerFunc) *Tester
Test initializes a test harness for a single handler.
func (*Tester) Do ¶
Do run the handler against req, honoring HijackResponseWriter semantics, materializes the result, then runs queued expectations (fail-fast).
Click to show internal directories.
Click to hide internal directories.