Home / Function/ Test_Ctx_DropWithMiddleware() — fiber Function Reference

Test_Ctx_DropWithMiddleware() — fiber Function Reference

Architecture documentation for the Test_Ctx_DropWithMiddleware() function in ctx_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  ec21789a_90b0_16c3_0e31_0150af3e5dfa["Test_Ctx_DropWithMiddleware()"]
  7b3d4933_5ae3_f84d_ff6d_0cb34e268026["ctx_test.go"]
  ec21789a_90b0_16c3_0e31_0150af3e5dfa -->|defined in| 7b3d4933_5ae3_f84d_ff6d_0cb34e268026
  style ec21789a_90b0_16c3_0e31_0150af3e5dfa fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

ctx_test.go lines 7994–8015

func Test_Ctx_DropWithMiddleware(t *testing.T) {
	t.Parallel()

	app := New()

	// Middleware that calls Drop
	app.Use(func(c Ctx) error {
		err := c.Next()
		c.Set("X-Test", "test")
		return err
	})

	// Handler that calls Drop
	app.Get("/block-me", func(c Ctx) error {
		return c.Drop()
	})

	// Test the Drop method
	resp, err := app.Test(httptest.NewRequest(MethodGet, "/block-me", http.NoBody))
	require.ErrorIs(t, err, ErrTestGotEmptyResponse)
	require.Nil(t, resp)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_Ctx_DropWithMiddleware() do?
Test_Ctx_DropWithMiddleware() is a function in the fiber codebase, defined in ctx_test.go.
Where is Test_Ctx_DropWithMiddleware() defined?
Test_Ctx_DropWithMiddleware() is defined in ctx_test.go at line 7994.

Analyze Your Own Codebase

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

Try Supermodel Free