Skip to content

Commit a341f5c

Browse files
authored
fix: Add no-op tests (#99)
Add no-op tests Signed-off-by: Todd Baert <[email protected]>
1 parent a0629b5 commit a341f5c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

test/no-op.spec.ts

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

0 commit comments

Comments
 (0)