Registry / testing / gavv-httpexpect-v2

gavv-httpexpect-v2

JSON →
library2.17.0gogounverified

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

go get github.com/gavv/httpexpect/v2
INSTALL
IMPORT
SIG · GAVV-HTTPEXPECT-V2
G
gavv-httpexpect-v2
testinggov2.17.0
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/v2

Test an HTTP API endpoint

package main import ( "net/http/httptest" "testing" "github.com/gavv/httpexpect/v2" ) func TestAPI(t *testing.T) { server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte(`{"message":"hello"}`)) })) defer server.Close() e := httpexpect.New(t, server.URL) e.GET("/").Expect().Status(http.StatusOK).JSON().Object().ValueEqual("message", "hello") }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
2.17.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
22
Amazon
1
Resources
gavv-httpexpect-v2 — go get gavv-httpexpect-v2 · libregistry