Skip to content

Commit

Permalink
fix: Add no-op tests (open-feature#99)
Browse files Browse the repository at this point in the history
Add no-op tests

Signed-off-by: Todd Baert <[email protected]>
  • Loading branch information
toddbaert authored Jul 22, 2022
1 parent a0629b5 commit a341f5c
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test/no-op.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { OpenFeatureClient } from '../src/client.js';
import { OpenFeature } from '../src/open-feature.js';

const BOOLEAN_VALUE = true;
const STRING_VALUE = 'val';
const NUMBER_VALUE = 2034;
const OBJECT_VALUE = {
key: 'value',
};

const NO_OP_FLAG = 'no-op-flag';

describe(OpenFeatureClient.name, () => {
describe('No-op behavior', () => {
// create a no-op client.
const client = OpenFeature.getClient();

it('should default all evaluations', async () => {
await expect(client.getBooleanValue(NO_OP_FLAG, BOOLEAN_VALUE)).resolves.toEqual(BOOLEAN_VALUE);
await expect(client.getStringValue(NO_OP_FLAG, STRING_VALUE)).resolves.toEqual(STRING_VALUE);
await expect(client.getNumberValue(NO_OP_FLAG, NUMBER_VALUE)).resolves.toEqual(NUMBER_VALUE);
await expect(client.getObjectValue(NO_OP_FLAG, OBJECT_VALUE)).resolves.toEqual(OBJECT_VALUE);
});
});
});

0 comments on commit a341f5c

Please sign in to comment.