mirror of
https://github.com/openclaw/clawhub.git
synced 2026-08-14 00:47:57 +00:00
Adds isolated Convex-backed Vercel PR previews with shared local/preview seeding, preview-safe routing, and production guards.
27 lines
1022 B
TypeScript
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");
|
|
});
|
|
});
|