import { describe, expect, it } from "vitest"; import { resolvePrismaConnectionLimit } from "./prisma-pool"; describe("resolvePrismaConnectionLimit", () => { it("caps the pool during production build phases", () => { expect(resolvePrismaConnectionLimit(40, "phase-production-build")).toBe(5); expect( resolvePrismaConnectionLimit(40, "phase-production-compile"), ).toBe(5); expect(resolvePrismaConnectionLimit(3, "phase-production-build")).toBe(3); }); it("keeps the configured pool outside build", () => { expect(resolvePrismaConnectionLimit(40, undefined)).toBe(40); expect(resolvePrismaConnectionLimit(40, "phase-development-server")).toBe( 40, ); }); });