Skip to content

Commit

Permalink
Add test for when variable not present in config
Browse files Browse the repository at this point in the history
  • Loading branch information
jamie-suse committed Feb 23, 2024
1 parent cbfb875 commit d11520f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions assets/js/lib/config/config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@ describe('getFromConfig', () => {

expect(fetchedConfigVariable).toEqual(123);
});

it('should return undefined when variable is not available the config', () => {
const fetchedConfigVariable = getFromConfig('variableThatDoesntExist');

expect(fetchedConfigVariable).toBeUndefined();
});
});

0 comments on commit d11520f

Please sign in to comment.