aboutsummaryrefslogtreecommitdiff
path: root/test/js/third_party/jsonwebtoken/non_object_values.test.js
diff options
context:
space:
mode:
authorGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-14 12:58:30 -0700
committerGravatar Dylan Conway <dylan.conway567@gmail.com> 2023-10-14 12:58:30 -0700
commitf9add8b6bea4df3cdbd56a21f17e4cab1a854e4e (patch)
tree8e5306104d81c67b771181337bba02cd9ec39453 /test/js/third_party/jsonwebtoken/non_object_values.test.js
parent81a1a58d66c598ea35c42453d0ba4c6341a940fc (diff)
parent9b5e66453b0879ed77b71dcdbe50e4efa184261e (diff)
downloadbun-sdl.tar.gz
bun-sdl.tar.zst
bun-sdl.zip
Merge branch 'main' into sdlsdl
Diffstat (limited to 'test/js/third_party/jsonwebtoken/non_object_values.test.js')
-rw-r--r--test/js/third_party/jsonwebtoken/non_object_values.test.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/js/third_party/jsonwebtoken/non_object_values.test.js b/test/js/third_party/jsonwebtoken/non_object_values.test.js
new file mode 100644
index 000000000..55b5d59ae
--- /dev/null
+++ b/test/js/third_party/jsonwebtoken/non_object_values.test.js
@@ -0,0 +1,16 @@
+import jwt from "jsonwebtoken";
+import { expect, describe, it } from "bun:test";
+
+describe("non_object_values values", function () {
+ it("should work with string", function () {
+ var token = jwt.sign("hello", "123");
+ var result = jwt.verify(token, "123");
+ expect(result).toEqual("hello");
+ });
+
+ it("should work with number", function () {
+ var token = jwt.sign(123, "123");
+ var result = jwt.verify(token, "123");
+ expect(result).toEqual("123");
+ });
+});