Registry / testing / gavv-httpexpect

gavv-httpexpect

JSON →
library2.0.0+incompatiblegogounverified

Package httpexpect helps with end-to-end HTTP and REST API testing.

go get github.com/gavv/httpexpect
INSTALL
IMPORT
SIG · GAVV-HTTPEXPECT
G
gavv-httpexpect
testinggov2.0.0+incompatible
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

httpexpect
✓ github.com/gavv/httpexpect

Test an HTTP handler with fluent assertions.

package main import ( "net/http" "testing" "github.com/gavv/httpexpect" ) func TestAPI(t *testing.T) { handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(`{"message":"hello"}`)) }) e := httpexpect.WithConfig(httpexpect.Config{ BaseURL: "http://example.com", Reporter: httpexpect.NewAssertReporter(t), Client: &http.Client{Transport: httpexpect.NewBinder(handler)}, }) e.GET("/"). Expect(). Status(http.StatusOK). JSON().Object(). ValueEqual("message", "hello") }
Debug
Known issues
breakingVersion 2.0.0+incompatible uses a different API than v1; check migration guide.
fix
Use v2 API: httpexpect.WithConfig instead of httpexpect.New.
affects: >=2.0.0
Upgrade
Version history
2.0.0+incompatiblelatest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources
gavv-httpexpect — go get gavv-httpexpect · libregistry