Home / Function/ Test_Custom_Favicon_Data() — fiber Function Reference

Test_Custom_Favicon_Data() — fiber Function Reference

Architecture documentation for the Test_Custom_Favicon_Data() function in favicon_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  9abfc58d_74ff_1cbf_9eda_b85808135ccc["Test_Custom_Favicon_Data()"]
  058ee3d4_5abb_335a_93ae_b3b07b8cfdd0["favicon_test.go"]
  9abfc58d_74ff_1cbf_9eda_b85808135ccc -->|defined in| 058ee3d4_5abb_335a_93ae_b3b07b8cfdd0
  style 9abfc58d_74ff_1cbf_9eda_b85808135ccc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/favicon/favicon_test.go lines 143–162

func Test_Custom_Favicon_Data(t *testing.T) {
	data, err := os.ReadFile("../../.github/testdata/favicon.ico")
	require.NoError(t, err)

	app := fiber.New()

	app.Use(New(Config{
		Data: data,
	}))

	app.Get("/", func(_ fiber.Ctx) error {
		return nil
	})

	resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/favicon.ico", http.NoBody))
	require.NoError(t, err, "app.Test(req)")
	require.Equal(t, fiber.StatusOK, resp.StatusCode, "Status code")
	require.Equal(t, "image/x-icon", resp.Header.Get(fiber.HeaderContentType))
	require.Equal(t, "public, max-age=31536000", resp.Header.Get(fiber.HeaderCacheControl), "CacheControl Control")
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Custom_Favicon_Data() do?
Test_Custom_Favicon_Data() is a function in the fiber codebase, defined in middleware/favicon/favicon_test.go.
Where is Test_Custom_Favicon_Data() defined?
Test_Custom_Favicon_Data() is defined in middleware/favicon/favicon_test.go at line 143.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free