MCPcopy Index your code
hub / github.com/labstack/echo / TestNewWithConfig

Function TestNewWithConfig

echo_test.go:71–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

69}
70
71func TestNewWithConfig(t *testing.T) {
72 e := NewWithConfig(Config{})
73 req := httptest.NewRequest(http.MethodGet, "/", nil)
74 rec := httptest.NewRecorder()
75
76 e.GET("/", func(c *Context) error {
77 return c.String(http.StatusTeapot, "Hello, World!")
78 })
79 e.ServeHTTP(rec, req)
80
81 assert.Equal(t, http.StatusTeapot, rec.Code)
82 assert.Equal(t, `Hello, World!`, rec.Body.String())
83}
84
85func TestNewDefaultFS(t *testing.T) {
86 tempDir := t.TempDir()

Callers

nothing calls this directly

Calls 4

NewWithConfigFunction · 0.85
ServeHTTPMethod · 0.80
GETMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…