-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test + comments and filter invalid flags
- Loading branch information
1 parent
f128fc0
commit 388ff1d
Showing
6 changed files
with
36 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { describe, expect, it } from "vitest" | ||
import { StatsigConfig } from '../../constants/abacus' | ||
import { StatSigFlags } from "../../types/statsig" | ||
import abacusStateManager from "../abacus" | ||
|
||
describe('setStatsigConfigs', () => { | ||
it('only sets properties that exist in the kotlin object', () => { | ||
abacusStateManager.setStatsigConfigs({ | ||
[StatSigFlags.ffEnableEvmSwaps]: true, | ||
'nonexistent_flag': true, | ||
}) | ||
expect(StatsigConfig.ff_enable_evm_swaps).toBe(true) | ||
// @ts-ignore | ||
expect(StatsigConfig.nonexistent_flag).toBeUndefined() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
export type StatsigConfigType = Record<StatSigFlags, boolean>; | ||
|
||
/** | ||
* !README!: | ||
* If you are using a flag in abacus, you must add it to the abacus | ||
* StatsigConfig object first! Otherwise it won't be set in the StatsigConfig object | ||
*/ | ||
export enum StatSigFlags { | ||
ffSkipMigration = 'ff_skip_migration', | ||
ffShowPredictionMarketsUi = 'ff_show_prediction_markets_ui', | ||
ffEnableEvmSwaps = 'ff_enable_evm_swaps', | ||
} |