summaryrefslogtreecommitdiffhomepage
path: root/packages/server/src/helpers/isBase64URLString.test.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2022-04-11 20:59:35 -0700
committerGitHub <noreply@github.com>2022-04-11 20:59:35 -0700
commitf46a315898dd31af268f7b36b39f1a28720c0072 (patch)
tree908c9ca31d5f61339c4a994c8448f1c6c86ad7db /packages/server/src/helpers/isBase64URLString.test.ts
parent338f0543ac7b5844116d5ec081cc964232de3ae8 (diff)
parentda3c7005c4f4ffd90ede382bcd329ae2aaa5d2bd (diff)
Merge pull request #193 from TaigaMikami/feature/add-server-helpers-test
add some server helper's function test
Diffstat (limited to 'packages/server/src/helpers/isBase64URLString.test.ts')
-rw-r--r--packages/server/src/helpers/isBase64URLString.test.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/packages/server/src/helpers/isBase64URLString.test.ts b/packages/server/src/helpers/isBase64URLString.test.ts
new file mode 100644
index 0000000..f91aeb1
--- /dev/null
+++ b/packages/server/src/helpers/isBase64URLString.test.ts
@@ -0,0 +1,16 @@
+import isBase64URLString from './isBase64URLString';
+
+test('should return true when input is base64URLString', () => {
+ const actual = isBase64URLString("U2ltcGxlV2ViQXV0aG4")
+ expect(actual).toEqual(true);
+});
+
+test('should return false when input is not base64URLString', () => {
+ const actual = isBase64URLString("U2ltcGxlV2ViQXV0aG4+")
+ expect(actual).toEqual(false);
+});
+
+test('should return false when input is blank', () => {
+ const actual = isBase64URLString("")
+ expect(actual).toEqual(false);
+});