Home / Function/ Test_CacheInvalidation_noCacheEntry() — fiber Function Reference

Test_CacheInvalidation_noCacheEntry() — fiber Function Reference

Architecture documentation for the Test_CacheInvalidation_noCacheEntry() function in cache_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  d765f5a5_8838_8277_ad4b_6db6e3411b0d["Test_CacheInvalidation_noCacheEntry()"]
  8453a087_9678_fe96_1b20_2d125b6f8656["cache_test.go"]
  d765f5a5_8838_8277_ad4b_6db6e3411b0d -->|defined in| 8453a087_9678_fe96_1b20_2d125b6f8656
  style d765f5a5_8838_8277_ad4b_6db6e3411b0d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/cache/cache_test.go lines 1310–1327

func Test_CacheInvalidation_noCacheEntry(t *testing.T) {
	t.Parallel()
	t.Run("Cache Invalidator should not be called if no cache entry exist ", func(t *testing.T) {
		t.Parallel()
		app := fiber.New()
		cacheInvalidatorExecuted := false
		app.Use(New(Config{
			CacheInvalidator: func(c fiber.Ctx) bool {
				cacheInvalidatorExecuted = true
				return fiber.Query[bool](c, "invalidate")
			},
			MaxBytes: 10 * 1024 * 1024,
		}))
		_, err := app.Test(httptest.NewRequest(fiber.MethodGet, "/?invalidate=true", http.NoBody))
		require.NoError(t, err)
		require.False(t, cacheInvalidatorExecuted)
	})
}

Subdomains

Frequently Asked Questions

What does Test_CacheInvalidation_noCacheEntry() do?
Test_CacheInvalidation_noCacheEntry() is a function in the fiber codebase, defined in middleware/cache/cache_test.go.
Where is Test_CacheInvalidation_noCacheEntry() defined?
Test_CacheInvalidation_noCacheEntry() is defined in middleware/cache/cache_test.go at line 1310.

Analyze Your Own Codebase

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

Try Supermodel Free