Files
clawhub/scripts/vercel-build-frontend.test.ts
T
Patrick Erichsen dfca6f5d9d feat: add disposable Vercel and Convex PR previews (#3017)
Adds isolated Convex-backed Vercel PR previews with shared local/preview seeding, preview-safe routing, and production guards.
2026-07-08 20:54:09 -07:00

27 lines
1022 B
TypeScript

import { describe, expect, it } from "vitest";
import { resolveFrontendBuildEnv } from "./vercel-build-frontend";
describe("Vercel frontend build environment", () => {
it("derives the preview site URL from the Convex CLI injected cloud URL", () => {
const env = resolveFrontendBuildEnv({
VERCEL_ENV: "preview",
VITE_CONVEX_URL: "https://paired-preview-123.convex.cloud",
VITE_CONVEX_SITE_URL: "https://wry-manatee-359.convex.site",
});
expect(env.VITE_CONVEX_SITE_URL).toBe("https://paired-preview-123.convex.site");
expect(env.VITE_CLAWHUB_DEPLOY_ENV).toBe("preview");
});
it("preserves an explicit production site URL", () => {
const env = resolveFrontendBuildEnv({
VERCEL_ENV: "production",
VITE_CONVEX_URL: "https://wry-manatee-359.convex.cloud",
VITE_CONVEX_SITE_URL: "https://api.clawhub.example",
});
expect(env.VITE_CONVEX_SITE_URL).toBe("https://api.clawhub.example");
expect(env.VITE_CLAWHUB_DEPLOY_ENV).toBe("production");
});
});