Home / Function/ newTestCtx() — fiber Function Reference

newTestCtx() — fiber Function Reference

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

Function go FiberCore Context called by 18

Entity Profile

Dependency Diagram

graph TD
  3776f9ef_b978_a0be_2199_412bb0eee3ec["newTestCtx()"]
  3ad7a4ef_7f07_008c_234d_52c9a342aa98["adapter_test.go"]
  3776f9ef_b978_a0be_2199_412bb0eee3ec -->|defined in| 3ad7a4ef_7f07_008c_234d_52c9a342aa98
  d19fb6a0_42c3_211a_9fa7_fddb9d02f868["TestToFiberHandler_FiberHandlerNoErrorReturn()"]
  d19fb6a0_42c3_211a_9fa7_fddb9d02f868 -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  bca23f0b_db9b_b0ec_7089_04a511fcc42a["TestNewTestCtx_ReturnsDefaultCtx()"]
  bca23f0b_db9b_b0ec_7089_04a511fcc42a -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  a48783fb_11c6_ffef_75d6_acc48c1b2987["TestToFiberHandler_ExpressTwoParamsWithError()"]
  a48783fb_11c6_ffef_75d6_acc48c1b2987 -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  8e750683_3617_64b2_388b_690d00d87492["TestToFiberHandler_ExpressTwoParamsWithoutError()"]
  8e750683_3617_64b2_388b_690d00d87492 -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  c8bb23ac_7d6c_b77a_11f9_6c941fde8f0e["TestToFiberHandler_ExpressThreeParamsWithError()"]
  c8bb23ac_7d6c_b77a_11f9_6c941fde8f0e -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  b30ba666_b114_bf2a_3f74_febd5b3f2180["TestToFiberHandler_ExpressThreeParamsWithoutError()"]
  b30ba666_b114_bf2a_3f74_febd5b3f2180 -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  4b5db832_05ba_95a2_a031_02aecd564147["TestToFiberHandler_ExpressNextNoArgWithErrorReturn()"]
  4b5db832_05ba_95a2_a031_02aecd564147 -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  3dc9c7e9_052f_df5b_3522_ec2b5733481b["TestToFiberHandler_ExpressNextWithErrorContinuesOnNil()"]
  3dc9c7e9_052f_df5b_3522_ec2b5733481b -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  2cf7c0d3_ced3_1f9d_0ac3_34bffd8df052["TestToFiberHandler_ExpressNextWithErrorShortCircuitsOnError()"]
  2cf7c0d3_ced3_1f9d_0ac3_34bffd8df052 -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  75e6aee8_e16e_abff_282f_3ad6354f7eb4["TestToFiberHandler_ExpressNextWithErrorReturn_ShortCircuitsOnNextError()"]
  75e6aee8_e16e_abff_282f_3ad6354f7eb4 -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  e00611c8_aebf_62cd_61a9_d63ea4f4fbda["TestToFiberHandler_ExpressNextWithErrorReturnCallback_PropagatesNextError()"]
  e00611c8_aebf_62cd_61a9_d63ea4f4fbda -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  74a356d3_a58b_3ee2_af16_d97ac7a7945c["TestToFiberHandler_ExpressNextWithErrorReturnCallback_ShortCircuitsOnNextError()"]
  74a356d3_a58b_3ee2_af16_d97ac7a7945c -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  214ff9bb_9ed6_98a2_0710_1268450b916e["TestToFiberHandler_ExpressNextWithErrorReturn_PrefersHandlerErrorOverNextError()"]
  214ff9bb_9ed6_98a2_0710_1268450b916e -->|calls| 3776f9ef_b978_a0be_2199_412bb0eee3ec
  style 3776f9ef_b978_a0be_2199_412bb0eee3ec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

adapter_test.go lines 66–80

func newTestCtx(t *testing.T) (*App, *DefaultCtx) {
	t.Helper()

	app := New()
	fasthttpCtx := &fasthttp.RequestCtx{}
	customCtx := app.AcquireCtx(fasthttpCtx)
	ctx, ok := customCtx.(*DefaultCtx)
	require.True(t, ok)

	t.Cleanup(func() {
		app.ReleaseCtx(customCtx)
	})

	return app, ctx
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does newTestCtx() do?
newTestCtx() is a function in the fiber codebase, defined in adapter_test.go.
Where is newTestCtx() defined?
newTestCtx() is defined in adapter_test.go at line 66.
What calls newTestCtx()?
newTestCtx() is called by 18 function(s): TestNewTestCtx_ReturnsDefaultCtx, TestToFiberHandler_ExpressNextNoArgPropagatesError, TestToFiberHandler_ExpressNextNoArgStopsChain, TestToFiberHandler_ExpressNextNoArgWithErrorReturn, TestToFiberHandler_ExpressNextWithErrorContinuesOnNil, TestToFiberHandler_ExpressNextWithErrorReturnCallback_PropagatesNextError, TestToFiberHandler_ExpressNextWithErrorReturnCallback_ShortCircuitsOnNextError, TestToFiberHandler_ExpressNextWithErrorReturnCallback_StopsChainWithoutNextCall, and 10 more.

Analyze Your Own Codebase

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

Try Supermodel Free