Files
openclaw/src/config/config.gateway-tools-config.test.ts
2026-02-13 14:48:45 +00:00

31 lines
734 B
TypeScript

import { describe, expect, it } from "vitest";
import { validateConfigObject } from "./config.js";
describe("gateway.tools config", () => {
it("accepts gateway.tools allow and deny lists", () => {
const res = validateConfigObject({
gateway: {
tools: {
allow: ["gateway"],
deny: ["sessions_spawn", "sessions_send"],
},
},
});
expect(res.ok).toBe(true);
});
it("rejects invalid gateway.tools values", () => {
const res = validateConfigObject({
gateway: {
tools: {
allow: "gateway",
},
},
});
expect(res.ok).toBe(false);
if (!res.ok) {
expect(res.issues[0]?.path).toBe("gateway.tools.allow");
}
});
});