final touches for beta skymoney (at least i think)

This commit is contained in:
2026-01-18 00:00:44 -06:00
parent 4eae966f96
commit f4f0ae5df2
161 changed files with 26016 additions and 1966 deletions

View File

@@ -9,6 +9,8 @@ process.env.DATABASE_URL =
process.env.PORT = process.env.PORT || "0"; // fastify can bind an ephemeral port
process.env.HOST ??= "127.0.0.1";
process.env.CORS_ORIGIN = process.env.CORS_ORIGIN || "";
process.env.AUTH_DISABLED = process.env.AUTH_DISABLED || "1";
process.env.SEED_DEFAULT_BUDGET = process.env.SEED_DEFAULT_BUDGET || "1";
export const prisma = new PrismaClient();
@@ -25,8 +27,18 @@ export async function resetUser(userId: string) {
beforeAll(async () => {
// make sure the schema is applied before running tests
execSync("npx prisma migrate deploy", { stdio: "inherit" });
// Ensure a clean slate: wipe all tables to avoid cross-file leakage
await prisma.$transaction([
prisma.allocation.deleteMany({}),
prisma.transaction.deleteMany({}),
prisma.incomeEvent.deleteMany({}),
prisma.fixedPlan.deleteMany({}),
prisma.variableCategory.deleteMany({}),
prisma.user.deleteMany({}),
]);
});
afterAll(async () => {
await prisma.$disconnect();
});
});