You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
451 B
17 lines
451 B
import { describe, expect, it, beforeEach } from "bun:test";
|
|
import { sessionTtlSeconds } from "../../server/utils/session-ttl";
|
|
|
|
describe("sessionTtlSeconds", () => {
|
|
beforeEach(() => {
|
|
delete process.env.SESSION_TTL_SECONDS;
|
|
});
|
|
|
|
it("defaults to 7d", () => {
|
|
expect(sessionTtlSeconds()).toBe(604800);
|
|
});
|
|
|
|
it("respects env", () => {
|
|
process.env.SESSION_TTL_SECONDS = "120";
|
|
expect(sessionTtlSeconds()).toBe(120);
|
|
});
|
|
});
|
|
|