MCPcopy
hub / github.com/go-chi/chi / testHandler

Function testHandler

mux_test.go:2006–2011  ·  view source on GitHub ↗
(t *testing.T, h http.Handler, method, path string, body io.Reader)

Source from the content-addressed store, hash-verified

2004}
2005
2006func testHandler(t *testing.T, h http.Handler, method, path string, body io.Reader) (*http.Response, string) {
2007 r, _ := http.NewRequest(method, path, body)
2008 w := httptest.NewRecorder()
2009 h.ServeHTTP(w, r)
2010 return w.Result(), w.Body.String()
2011}
2012
2013type ctxKey struct {
2014 name string

Callers 1

TestMuxEmptyRoutesFunction · 0.85

Calls 2

ServeHTTPMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected