diff options
Diffstat (limited to 'test/js/third_party/jsonwebtoken/buffer.test.js')
-rw-r--r-- | test/js/third_party/jsonwebtoken/buffer.test.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/js/third_party/jsonwebtoken/buffer.test.js b/test/js/third_party/jsonwebtoken/buffer.test.js new file mode 100644 index 000000000..28d310221 --- /dev/null +++ b/test/js/third_party/jsonwebtoken/buffer.test.js @@ -0,0 +1,10 @@ +import jwt from "jsonwebtoken"; +import { expect, describe, it } from "bun:test"; + +describe("buffer payload", function () { + it("should work", function () { + var payload = new Buffer("TkJyotZe8NFpgdfnmgINqg==", "base64"); + var token = jwt.sign(payload, "signing key"); + expect(jwt.decode(token)).toBe(payload.toString()); + }); +}); |