16 lines
480 B
TypeScript
16 lines
480 B
TypeScript
import { execFileSync } from "node:child_process";
|
|
import { describe, expect, it } from "vitest";
|
|
import nextConfig from "../../next.config";
|
|
|
|
describe("deployment version skew protection", () => {
|
|
it("uses an explicit deployment ID or the current Git commit", () => {
|
|
const gitCommit = execFileSync("git", ["rev-parse", "HEAD"], {
|
|
encoding: "utf8",
|
|
}).trim();
|
|
|
|
expect(nextConfig.deploymentId).toBe(
|
|
process.env.NEXT_DEPLOYMENT_ID?.trim() || gitCommit,
|
|
);
|
|
});
|
|
});
|