Files
bun.sh/test/js/third_party/jsonwebtoken/noTimestamp.test.js
2024-09-03 21:32:52 -07:00

12 lines
412 B
JavaScript

import { describe, expect, it } from "bun:test";
import jwt from "jsonwebtoken";
describe("noTimestamp", function () {
it("should work with string", function () {
var exp = Math.floor(Date.now() / 1000) + 5 * 60;
var token = jwt.sign({ foo: 123 }, "123", { expiresIn: "5m", noTimestamp: true });
var result = jwt.verify(token, "123");
expect(result.exp).toBeGreaterThanOrEqual(exp);
});
});