Documentation ¶
Overview ¶
Package testing provides utilities for tests that depend on feature flags.
Feature flags are shared state. When tests change feature flags, they must ensure that no other tests are affected.
- They must restore the default feature flag state when the test is finished.
- They must not run in parallel with other tests that could be affected by changed feature flags state.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithFeatureFlag ¶
func WithFeatureFlag(ff *featureflag.FeatureFlag, enabled bool) func()
WithFeatureFlag sets the given feature flag to the given state and returns a reset function to revert to the previous feature flag state.
The returned function is meant to be called deferred by the caller.
Example:
defer testing.WithFeatureFlag(featureflag.Dummy, true)()
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.