MCPcopy
hub / github.com/gofiber/fiber / Test_Domain_Head

Function Test_Domain_Head

domain_test.go:283–298  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

281}
282
283func Test_Domain_Head(t *testing.T) {
284 t.Parallel()
285
286 app := New()
287
288 app.Domain("api.example.com").Head("/test", func(c Ctx) error {
289 c.Set("X-Custom", "head")
290 return c.SendStatus(StatusOK)
291 })
292
293 req := httptest.NewRequest(MethodHead, "/test", http.NoBody)
294 req.Host = "api.example.com"
295 resp, err := app.Test(req)
296 require.NoError(t, err)
297 require.Equal(t, StatusOK, resp.StatusCode)
298}
299
300func Test_Domain_All(t *testing.T) {
301 t.Parallel()

Callers

nothing calls this directly

Calls 6

TestMethod · 0.80
NewFunction · 0.70
HeadMethod · 0.65
DomainMethod · 0.65
SetMethod · 0.65
SendStatusMethod · 0.65

Tested by

no test coverage detected