refactor: make the feature package easier to mock
The following discussion from !642 (merged) should be addressed:
-
@vshushlin started a discussion: (+2 comments) This is a bit of glue between tests and
featurepackage. We passenvVaras the string mainly to resolve the circular dependency betweenfeatureandtesthelpers- tests for
featureusetesthelpers.SetEnvironmentVariable - I'd love this function
func StubFeatureFlagValue(t testing.TB, f feature.Feature, value bool), but it would be circular dependency - I also considered something like
func (f Feature) Stub(t testing.TB, value bool), but I don't want to pull the whole testing package anywhere outside of tests
So I just use string names. This is also why
EnvVariableis exported byFeaturetypeI think we can iterate on solution later.
- tests for