All checks were successful
Build & Deploy to Staging / Build & Deploy to Staging (push) Successful in 18m37s
- Delete src/routes/signup.ts (dead code, 410 handler in index.ts remains) - Remove isEmailVerified() and getVerifiedApiKey() from verification.ts (only used by signup) - Remove stale-key cleanup from cleanupStaleData() that queried legacy verifications table - Update usage middleware message: 'Free tier limit' → 'Account limit' - TDD: 8 new tests, removed signup.test.ts (dead), net 556 tests passing
44 lines
1.8 KiB
TypeScript
44 lines
1.8 KiB
TypeScript
import { describe, it, expect } from "vitest";
|
|
import { readFileSync, existsSync } from "fs";
|
|
import { join } from "path";
|
|
|
|
describe("Dead Signup Router Removal", () => {
|
|
describe("Signup router module removed", () => {
|
|
it("should not have src/routes/signup.ts file", () => {
|
|
const signupPath = join(__dirname, "../routes/signup.ts");
|
|
expect(existsSync(signupPath)).toBe(false);
|
|
});
|
|
});
|
|
|
|
describe("Dead verification functions removed from source", () => {
|
|
it("should not export isEmailVerified from verification.ts source", () => {
|
|
const src = readFileSync(join(__dirname, "../services/verification.ts"), "utf8");
|
|
expect(src).not.toContain("export async function isEmailVerified");
|
|
});
|
|
|
|
it("should not export getVerifiedApiKey from verification.ts source", () => {
|
|
const src = readFileSync(join(__dirname, "../services/verification.ts"), "utf8");
|
|
expect(src).not.toContain("export async function getVerifiedApiKey");
|
|
});
|
|
|
|
it("should still export createPendingVerification", () => {
|
|
const src = readFileSync(join(__dirname, "../services/verification.ts"), "utf8");
|
|
expect(src).toContain("export async function createPendingVerification");
|
|
});
|
|
|
|
it("should still export verifyCode", () => {
|
|
const src = readFileSync(join(__dirname, "../services/verification.ts"), "utf8");
|
|
expect(src).toContain("export async function verifyCode");
|
|
});
|
|
});
|
|
|
|
describe("410 signup handler still works", () => {
|
|
it("should still have signup 410 handler working", async () => {
|
|
const request = (await import("supertest")).default;
|
|
const { app } = await import("../index.js");
|
|
const res = await request(app).post("/v1/signup/free");
|
|
expect(res.status).toBe(410);
|
|
expect(res.body.error).toContain("discontinued");
|
|
});
|
|
});
|
|
});
|