mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 18:38:55 +00:00
12 lines
412 B
JavaScript
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);
|
|
});
|
|
});
|