Skip to content

Commit 8f699f8

Browse files
authored
Make featureflag.MockClient return enabled flags in AllEnabledFlags (#190)
The MockClient should respect the flags set for it.
1 parent 809312a commit 8f699f8

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

featureflag/mock.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,11 @@ func (c MockClient) VariationUser(key string, defaultVal string, _ ld.User) stri
3232
}
3333

3434
func (c MockClient) AllEnabledFlags(string) []string {
35-
return []string{}
35+
var res []string
36+
for key, value := range c.BoolVars {
37+
if value {
38+
res = append(res, key)
39+
}
40+
}
41+
return res
3642
}

0 commit comments

Comments
 (0)