Skip to content
Merged
Prev Previous commit
Next Next commit
Improve Base64 unit tests
  • Loading branch information
ernestognw committed Jan 11, 2024
commit 7cfe5071a4be858446d92ac5c18df929a99bcf19
6 changes: 4 additions & 2 deletions test/utils/Base64.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ describe('Strings', function () {
{ title: 'converts to base64 encoded string with double padding', input: 'test', expected: 'dGVzdA==' },
{ title: 'converts to base64 encoded string with single padding', input: 'test1', expected: 'dGVzdDE=' },
{ title: 'converts to base64 encoded string without padding', input: 'test12', expected: 'dGVzdDEy' },
{ title: 'converts to base64 encoded string (special case)', input: 'où', expected: 'b/k=' },
{ title: 'converts to base64 encoded string (/ case)', input: 'où', expected: 'b/k=' },
{ title: 'converts to base64 encoded string (+ case)', input: 'zs~1t8', expected: 'enN+MXQ4' },
{ title: 'empty bytes', input: '', expected: '' },
])
it(title, async function () {
Expand All @@ -36,7 +37,8 @@ describe('Strings', function () {
{ title: 'converts to base64url encoded string with double padding', input: 'test', expected: 'dGVzdA' },
{ title: 'converts to base64url encoded string with single padding', input: 'test1', expected: 'dGVzdDE' },
{ title: 'converts to base64url encoded string without padding', input: 'test12', expected: 'dGVzdDEy' },
{ title: 'converts to base64url encoded string (special case)', input: 'où', expected: 'b_k' },
{ title: 'converts to base64url encoded string (_ case)', input: 'où', expected: 'b_k' },
{ title: 'converts to base64url encoded string (- case)', input: 'zs~1t8', expected: 'enN-MXQ4' },
{ title: 'empty bytes', input: '', expected: '' },
])
it(title, async function () {
Expand Down