2022-04-08 05:42:33 -05:00
|
|
|
package featuremgmt
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestFeatureUsageStats(t *testing.T) {
|
|
|
|
featureManagerWithAllFeatures := WithFeatures(
|
|
|
|
"database_metrics",
|
|
|
|
"live-config",
|
|
|
|
"UPPER_SNAKE_CASE",
|
|
|
|
"feature.with.a.dot",
|
|
|
|
)
|
|
|
|
|
2023-08-30 10:46:47 -05:00
|
|
|
require.Equal(t, map[string]any{
|
2023-02-08 18:01:34 -06:00
|
|
|
"stats.features.database_metrics.count": 1,
|
|
|
|
"stats.features.live_config.count": 1,
|
|
|
|
"stats.features.upper_snake_case.count": 1,
|
|
|
|
"stats.features.feature_with_a_dot.count": 1,
|
2022-04-08 05:42:33 -05:00
|
|
|
}, featureManagerWithAllFeatures.GetUsageStats(context.Background()))
|
|
|
|
}
|