51f95e0fd6
Part of GRO-802 monorepo breakdown. Changes: - Extract apps/api/ as the main API service - Inline packages/db/ (database schema, migrations, utilities) - Inline packages/types/ (shared TypeScript types) - Add CI workflow for lint, typecheck, test, build, docker - Port Dockerfile with 4 stages: runner, migrate, seed, reset Co-Authored-By: Paperclip <noreply@paperclip.ing>
16 lines
486 B
TypeScript
16 lines
486 B
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { generateIcalToken } from "../routes/calendar.js";
|
|
|
|
describe("generateIcalToken", () => {
|
|
it("generates a 64-character hex token", () => {
|
|
const token = generateIcalToken();
|
|
expect(token).toHaveLength(64);
|
|
expect(token).toMatch(/^[a-f0-9]+$/);
|
|
});
|
|
|
|
it("generates unique tokens", () => {
|
|
const token1 = generateIcalToken();
|
|
const token2 = generateIcalToken();
|
|
expect(token1).not.toBe(token2);
|
|
});
|
|
}); |