Skip to content

Commit 216afc5

Browse files
committed
tests: add test on flagsource export
1 parent 72be79a commit 216afc5

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/flagsource-export.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
});

0 commit comments

Comments
 (0)