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

Function TestConfigDefaultWithCustomConfig

middleware/session/config_test.go:23–35  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

21}
22
23func TestConfigDefaultWithCustomConfig(t *testing.T) {
24 // Test custom config
25 customConfig := Config{
26 IdleTimeout: 48 * time.Hour,
27 Extractor: extractors.FromHeader("X-Custom-Session"),
28 KeyGenerator: func() string { return "custom_key" },
29 }
30 cfg := configDefault(customConfig)
31 require.Equal(t, 48*time.Hour, cfg.IdleTimeout)
32 require.NotNil(t, cfg.KeyGenerator)
33 require.NotNil(t, cfg.Extractor)
34 require.Equal(t, "X-Custom-Session", cfg.Extractor.Key)
35}
36
37func TestDefaultErrorHandler(t *testing.T) {
38 // Create a new Fiber app

Callers

nothing calls this directly

Calls 2

FromHeaderFunction · 0.92
configDefaultFunction · 0.70

Tested by

no test coverage detected