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

Function Test_Domain_Name

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

Source from the content-addressed store, hash-verified

460}
461
462func Test_Domain_Name(t *testing.T) {
463 t.Parallel()
464
465 app := New()
466
467 app.Domain("api.example.com").Get("/test", func(c Ctx) error {
468 return c.SendString("ok")
469 }).Name("api-test")
470
471 // Verify route was named - by checking routes
472 var found bool
473 for _, routes := range app.Stack() {
474 for _, route := range routes {
475 if route.Name == "api-test" {
476 found = true
477 break
478 }
479 }
480 }
481 require.True(t, found, "route should be named 'api-test'")
482}
483
484func Test_Domain_NameWithGroup(t *testing.T) {
485 t.Parallel()

Callers

nothing calls this directly

Calls 6

StackMethod · 0.80
NewFunction · 0.70
NameMethod · 0.65
GetMethod · 0.65
DomainMethod · 0.65
SendStringMethod · 0.65

Tested by

no test coverage detected