Test_HTTPHandler_Flush_App_Test() — fiber Function Reference
Architecture documentation for the Test_HTTPHandler_Flush_App_Test() function in adaptor_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD eca10ada_8d56_604f_0833_4d7ec51bc8ec["Test_HTTPHandler_Flush_App_Test()"] 8ec96b38_44b4_af66_6f6f_dd60f87b680c["adaptor_test.go"] eca10ada_8d56_604f_0833_4d7ec51bc8ec -->|defined in| 8ec96b38_44b4_af66_6f6f_dd60f87b680c style eca10ada_8d56_604f_0833_4d7ec51bc8ec fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
middleware/adaptor/adaptor_test.go lines 208–234
func Test_HTTPHandler_Flush_App_Test(t *testing.T) {
t.Parallel()
app := fiber.New()
app.Get("/", HTTPHandlerFunc(func(w http.ResponseWriter, r *http.Request) {
flusher, ok := w.(http.Flusher)
if !ok {
t.Fatal("w does not implement http.Flusher")
}
w.WriteHeader(fiber.StatusOK)
fmt.Fprintf(w, "Hello ")
flusher.Flush()
time.Sleep(500 * time.Millisecond)
fmt.Fprintf(w, "World!")
}))
resp, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody))
require.NoError(t, err)
defer resp.Body.Close() //nolint:errcheck // not needed
require.Equal(t, fiber.StatusOK, resp.StatusCode)
body, err := io.ReadAll(resp.Body)
require.NoError(t, err)
require.Equal(t, "Hello World!", string(body))
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_HTTPHandler_Flush_App_Test() do?
Test_HTTPHandler_Flush_App_Test() is a function in the fiber codebase, defined in middleware/adaptor/adaptor_test.go.
Where is Test_HTTPHandler_Flush_App_Test() defined?
Test_HTTPHandler_Flush_App_Test() is defined in middleware/adaptor/adaptor_test.go at line 208.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free