Home / Function/ Test_Static_FS_Prefix_Wildcard() — fiber Function Reference

Test_Static_FS_Prefix_Wildcard() — fiber Function Reference

Architecture documentation for the Test_Static_FS_Prefix_Wildcard() function in static_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  aefbd69b_986e_a042_8d39_cb7b5db5ef59["Test_Static_FS_Prefix_Wildcard()"]
  f26a2d79_1e01_f027_82eb_45c4308747e8["static_test.go"]
  aefbd69b_986e_a042_8d39_cb7b5db5ef59 -->|defined in| f26a2d79_1e01_f027_82eb_45c4308747e8
  style aefbd69b_986e_a042_8d39_cb7b5db5ef59 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/static/static_test.go lines 679–698

func Test_Static_FS_Prefix_Wildcard(t *testing.T) {
	t.Parallel()
	app := fiber.New()

	app.Get("/test*", New("index.html", Config{
		FS:         os.DirFS("../../.github"),
		IndexNames: []string{"not_index.html"},
	}))

	req := httptest.NewRequest(fiber.MethodGet, "/test/john/doe", http.NoBody)
	resp, err := app.Test(req)
	require.NoError(t, err, "app.Test(req)")
	require.Equal(t, 200, resp.StatusCode, "Status code")
	require.NotEmpty(t, resp.Header.Get(fiber.HeaderContentLength))
	require.Equal(t, fiber.MIMETextHTMLCharsetUTF8, resp.Header.Get(fiber.HeaderContentType))

	body, err := io.ReadAll(resp.Body)
	require.NoError(t, err)
	require.Contains(t, string(body), "Test file")
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Static_FS_Prefix_Wildcard() do?
Test_Static_FS_Prefix_Wildcard() is a function in the fiber codebase, defined in middleware/static/static_test.go.
Where is Test_Static_FS_Prefix_Wildcard() defined?
Test_Static_FS_Prefix_Wildcard() is defined in middleware/static/static_test.go at line 679.

Analyze Your Own Codebase

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

Try Supermodel Free