Skip to content

Commit

Permalink
test(flagsmith): asserting boolean default parameter outside of const…
Browse files Browse the repository at this point in the history
…ructor is also taken into account
  • Loading branch information
uriell committed Jul 25, 2024
1 parent 30fefd8 commit e678553
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,18 @@ describe('FlagsmithProvider', () => {
expect(details.value).toEqual(0);
expect(details.reason).toEqual('ERROR');
});
it('should use defaults for flags that do not exist', async () => {
it('should use defaults for number flags that do not exist', async () => {
await OpenFeature.setProviderAndWait(provider);
const details = client.getNumberDetails('dont exist', 0);
expect(details.value).toEqual(0);
expect(details.reason).toEqual('DEFAULT');
});
it('should use defaults for boolean flags that do not exist', async () => {
await OpenFeature.setProviderAndWait(provider);
const details = client.getBooleanDetails('dont exist', false);
expect(details.value).toEqual(false);
expect(details.reason).toEqual('DEFAULT');
});
});
describe('events', () => {
it('should call the ready handler when initialized', async () => {
Expand Down

0 comments on commit e678553

Please sign in to comment.