mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-07 18:26:17 +00:00
fix(cli): fail clearly on unsupported Node versions (#2388)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { runtimeVersionError } from "./runtimeVersion.js";
|
||||
|
||||
describe("runtimeVersionError", () => {
|
||||
it("rejects Node 20 before the bundled CLI is imported", () => {
|
||||
expect(runtimeVersionError("20.11.1")).toBe(
|
||||
"HyperFrames requires Node.js >= 22 (current: 20.11.1). Switch Node versions and retry.",
|
||||
);
|
||||
});
|
||||
|
||||
it("accepts supported Node releases", () => {
|
||||
expect(runtimeVersionError("22.0.0")).toBeNull();
|
||||
expect(runtimeVersionError("24.14.0")).toBeNull();
|
||||
});
|
||||
|
||||
it("rejects malformed versions safely", () => {
|
||||
expect(runtimeVersionError("unknown")).toContain("requires Node.js >= 22");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user