Home / Function/ TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() — fiber Function Reference

TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() — fiber Function Reference

Architecture documentation for the TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() function in adapter_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  6af6601b_6f03_b49e_6f6e_e2ea42ce87b2["TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall()"]
  3ad7a4ef_7f07_008c_234d_52c9a342aa98["adapter_test.go"]
  6af6601b_6f03_b49e_6f6e_e2ea42ce87b2 -->|defined in| 3ad7a4ef_7f07_008c_234d_52c9a342aa98
  3776f9ef_b978_a0be_2199_412bb0eee3ec["newTestCtx()"]
  6af6601b_6f03_b49e_6f6e_e2ea42ce87b2 -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  0ba29dbe_6ac4_3e52_572c_88fd521daa4b["withRouteHandlers()"]
  6af6601b_6f03_b49e_6f6e_e2ea42ce87b2 -->|calls| 0ba29dbe_6ac4_3e52_572c_88fd521daa4b
  style 6af6601b_6f03_b49e_6f6e_e2ea42ce87b2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

adapter_test.go lines 402–427

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

	app, ctx := newTestCtx(t)

	handler := func(req Req, res Res, _ func(error) error) {
		assert.Equal(t, app, req.App())
		assert.Equal(t, app, res.App())
		// Intentionally do not call next.
	}

	converted, ok := toFiberHandler(handler)
	require.True(t, ok)

	nextCalled := false
	nextHandler := func(_ Ctx) error {
		nextCalled = true
		return errors.New("should not be called")
	}

	withRouteHandlers(t, ctx, converted, nextHandler)

	err := converted(ctx)
	require.NoError(t, err)
	require.False(t, nextCalled)
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() do?
TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() is a function in the fiber codebase, defined in adapter_test.go.
Where is TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() defined?
TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() is defined in adapter_test.go at line 402.
What does TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() call?
TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall() calls 2 function(s): newTestCtx, withRouteHandlers.

Analyze Your Own Codebase

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

Try Supermodel Free