Home / Function/ Test_ServiceContextProviders() — fiber Function Reference

Test_ServiceContextProviders() — fiber Function Reference

Architecture documentation for the Test_ServiceContextProviders() function in services_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  d3463c72_12a7_64e6_0b51_e49e13075371["Test_ServiceContextProviders()"]
  a3b050d2_f10a_df85_e082_e3ac664a6a6c["services_test.go"]
  d3463c72_12a7_64e6_0b51_e49e13075371 -->|defined in| a3b050d2_f10a_df85_e082_e3ac664a6a6c
  style d3463c72_12a7_64e6_0b51_e49e13075371 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

services_test.go lines 478–505

func Test_ServiceContextProviders(t *testing.T) {
	t.Run("no-provider", func(t *testing.T) {
		app := &App{
			configured: Config{},
			state:      newState(),
		}
		require.Equal(t, context.Background(), app.servicesStartupCtx())
		require.Equal(t, context.Background(), app.servicesShutdownCtx())
	})

	t.Run("with-provider", func(t *testing.T) {
		ctx := context.TODO()
		app := &App{
			configured: Config{
				ServicesStartupContextProvider: func() context.Context {
					return ctx
				},
				ServicesShutdownContextProvider: func() context.Context {
					return ctx
				},
			},
			state: newState(),
		}

		require.Equal(t, ctx, app.servicesStartupCtx())
		require.Equal(t, ctx, app.servicesShutdownCtx())
	})
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_ServiceContextProviders() do?
Test_ServiceContextProviders() is a function in the fiber codebase, defined in services_test.go.
Where is Test_ServiceContextProviders() defined?
Test_ServiceContextProviders() is defined in services_test.go at line 478.

Analyze Your Own Codebase

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

Try Supermodel Free