Registry / testing / iris-contrib-httpexpect

iris-contrib-httpexpect

JSON →
library1.1.2gogounverified

Helps with end-to-end HTTP and REST API testing in Go, supporting various clients and frameworks.

go get github.com/iris-contrib/httpexpect
INSTALL
IMPORT
SIG · IRIS-CONTRIB-HTTPE
I
iris-contrib-httpexpect
testinggov1.1.2
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/iris-contrib/httpexpect

Test a simple HTTP handler using httpexpect.

package main import ( "net/http" "net/http/httptest" "github.com/iris-contrib/httpexpect" ) func main() { handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.Write([]byte("Hello")) }) server := httptest.NewServer(handler) defer server.Close() e := httpexpect.New(t, server.URL) e.GET("/").Expect().Status(http.StatusOK).Body().Equal("Hello") }
Debug
Known issues
gotchaThe package uses a custom 't' testing object; ensure you pass a *testing.T in test functions.
fix
Use httpexpect.New(t, ...) only inside test functions with *testing.T parameter.
affects: >=1.0.0
Upgrade
Version history
1.1.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
8
Resources
iris-contrib-httpexpect — go get iris-contrib-httpexpect · libregistry