File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ import { OpenFeatureClient } from '../src/client.js' ;
2+ import { OpenFeature } from '../src/open-feature.js' ;
3+
4+ const BOOLEAN_VALUE = true ;
5+ const STRING_VALUE = 'val' ;
6+ const NUMBER_VALUE = 2034 ;
7+ const OBJECT_VALUE = {
8+ key : 'value' ,
9+ } ;
10+
11+ const NO_OP_FLAG = 'no-op-flag' ;
12+
13+ describe ( OpenFeatureClient . name , ( ) => {
14+ describe ( 'No-op behavior' , ( ) => {
15+ // create a no-op client.
16+ const client = OpenFeature . getClient ( ) ;
17+
18+ it ( 'should default all evaluations' , async ( ) => {
19+ await expect ( client . getBooleanValue ( NO_OP_FLAG , BOOLEAN_VALUE ) ) . resolves . toEqual ( BOOLEAN_VALUE ) ;
20+ await expect ( client . getStringValue ( NO_OP_FLAG , STRING_VALUE ) ) . resolves . toEqual ( STRING_VALUE ) ;
21+ await expect ( client . getNumberValue ( NO_OP_FLAG , NUMBER_VALUE ) ) . resolves . toEqual ( NUMBER_VALUE ) ;
22+ await expect ( client . getObjectValue ( NO_OP_FLAG , OBJECT_VALUE ) ) . resolves . toEqual ( OBJECT_VALUE ) ;
23+ } ) ;
24+ } ) ;
25+ } ) ;
You can’t perform that action at this time.
0 commit comments