File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ import { FlagSource } from '../index' ;
2+ import { FlagSource as FlagSourceIso } from '../isomorphic' ;
3+
4+ describe ( 'FlagSource Export' , ( ) => {
5+
6+ test ( 'should export FlagSource enum with all values' , ( ) => {
7+ expect ( FlagSource ) . toBeDefined ( ) ;
8+ expect ( FlagSource . NONE ) . toBe ( 'NONE' ) ;
9+ expect ( FlagSource . DEFAULT_FLAGS ) . toBe ( 'DEFAULT_FLAGS' ) ;
10+ expect ( FlagSource . CACHE ) . toBe ( 'CACHE' ) ;
11+ expect ( FlagSource . SERVER ) . toBe ( 'SERVER' ) ;
12+ } ) ;
13+
14+ test ( 'should be usable in runtime value comparisons' , ( ) => {
15+ const source = 'NONE' as string ;
16+
17+ expect ( source === FlagSource . NONE ) . toBe ( true ) ;
18+ expect ( source === FlagSource . CACHE ) . toBe ( false ) ;
19+
20+ const mySource : FlagSource = FlagSource . NONE ;
21+ expect ( mySource ) . toBe ( 'NONE' ) ;
22+ } ) ;
23+
24+ test ( 'should export FlagSource from all entry points' , ( ) => {
25+ expect ( FlagSourceIso ) . toBeDefined ( ) ;
26+ expect ( FlagSourceIso . NONE ) . toBe ( 'NONE' ) ;
27+ expect ( FlagSource . NONE ) . toBe ( FlagSourceIso . NONE ) ;
28+ } ) ;
29+ } ) ;
You can’t perform that action at this time.
0 commit comments