Skip to content

Commit

Permalink
test: adds null and undefined tests
Browse files Browse the repository at this point in the history
  • Loading branch information
moltar committed Dec 10, 2023
1 parent 1426a79 commit fd05fa7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lib/util/template/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,20 @@ describe('util/template/index', () => {
);
expect(output).toBe('QGZzb3V6YS9wcmV0dGllcmQ=');
});

it('handles null values gracefully', () => {
const output = template.compile('{{{encodeBase64 packageName}}}', {
packageName: null,
});
expect(output).toBe('');
});

it('handles undefined values gracefully', () => {
const output = template.compile('{{{encodeBase64 packageName}}}', {
packageName: undefined,
});
expect(output).toBe('');
});
});

describe('equals', () => {
Expand Down

0 comments on commit fd05fa7

Please sign in to comment.