Updating tests.
This commit is contained in:
parent
21cc83daf4
commit
4995056ba0
|
@ -160,7 +160,7 @@ export class FlagSet<V extends Flag<any>, T extends { [key: string]: V }> {
|
|||
}
|
||||
|
||||
// ignore unknown flags
|
||||
if (this.isFlagName(feature)) {
|
||||
if (!this.isFlagName(feature)) {
|
||||
continue
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ export class FlagSet<V extends Flag<any>, T extends { [key: string]: V }> {
|
|||
|
||||
// @ts-expect-error - TS does not like you writing into a generic type,
|
||||
// but we know that it's okay in this case because it's just an object.
|
||||
flagValues[feature] = value
|
||||
flagValues[feature as keyof FlagValues] = value
|
||||
tags[`flags.${feature}.source`] = "environment"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -67,9 +67,9 @@ describe("feature flags", () => {
|
|||
expected: flags.defaults(),
|
||||
},
|
||||
{
|
||||
it: "should fail when an environment flag is not recognised",
|
||||
it: "should ignore unknown feature flags",
|
||||
environmentFlags: "default:TEST_BOOLEAN,default:FOO",
|
||||
errorMessage: "Feature: FOO is not an allowed option",
|
||||
expected: { TEST_BOOLEAN: true },
|
||||
},
|
||||
{
|
||||
it: "should be able to read boolean flags from PostHog",
|
||||
|
|
Loading…
Reference in New Issue