fix: stop partial replies for whatsapp/telegram surfaces
This commit is contained in:
@@ -5,8 +5,8 @@ import {
|
||||
detectRuntime,
|
||||
isAtLeast,
|
||||
parseSemver,
|
||||
runtimeSatisfies,
|
||||
type RuntimeDetails,
|
||||
runtimeSatisfies,
|
||||
} from "./runtime-guard.js";
|
||||
|
||||
describe("runtime-guard", () => {
|
||||
@@ -17,9 +17,24 @@ describe("runtime-guard", () => {
|
||||
});
|
||||
|
||||
it("compares versions correctly", () => {
|
||||
expect(isAtLeast({ major: 22, minor: 0, patch: 0 }, { major: 22, minor: 0, patch: 0 })).toBe(true);
|
||||
expect(isAtLeast({ major: 22, minor: 1, patch: 0 }, { major: 22, minor: 0, patch: 0 })).toBe(true);
|
||||
expect(isAtLeast({ major: 21, minor: 9, patch: 0 }, { major: 22, minor: 0, patch: 0 })).toBe(false);
|
||||
expect(
|
||||
isAtLeast(
|
||||
{ major: 22, minor: 0, patch: 0 },
|
||||
{ major: 22, minor: 0, patch: 0 },
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
isAtLeast(
|
||||
{ major: 22, minor: 1, patch: 0 },
|
||||
{ major: 22, minor: 0, patch: 0 },
|
||||
),
|
||||
).toBe(true);
|
||||
expect(
|
||||
isAtLeast(
|
||||
{ major: 21, minor: 9, patch: 0 },
|
||||
{ major: 22, minor: 0, patch: 0 },
|
||||
),
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("validates runtime thresholds", () => {
|
||||
@@ -49,7 +64,9 @@ describe("runtime-guard", () => {
|
||||
pathEnv: "/usr/bin",
|
||||
};
|
||||
expect(() => assertSupportedRuntime(runtime, details)).toThrow("exit");
|
||||
expect(runtime.error).toHaveBeenCalledWith(expect.stringContaining("requires Node"));
|
||||
expect(runtime.error).toHaveBeenCalledWith(
|
||||
expect.stringContaining("requires Node"),
|
||||
);
|
||||
});
|
||||
|
||||
it("returns silently when runtime meets requirements", () => {
|
||||
@@ -68,4 +85,3 @@ describe("runtime-guard", () => {
|
||||
expect(runtime.exit).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user