Documentation
¶
Overview ¶
Package configtest provides config-singleton setup helpers for tests. Kept separate from internal/testutil to avoid an import cycle: testutil is imported by config's own internal test suite, but this helper depends on internal/config.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Setup ¶
Setup seeds the process-wide config singleton with defaults plus any caller-supplied overrides, registers a DeferCleanup to reset the singleton, and returns the resulting *config.Config.
The data_dir key is automatically pointed at a Ginkgo-managed temp directory because config validation requires it to exist on disk. Overrides merge on top of defaults + the tmp data_dir — they use the same nested map shape as the YAML config file.
Intended for use in BeforeEach or BeforeSuite:
BeforeEach(func() { configtest.Setup(map[string]any{
"auth": map[string]any{
"session_secret": "test-secret",
"session_ttl": "1h",
},
}) })
Types ¶
This section is empty.