mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 14:51:08 +00:00
15 lines
545 B
TypeScript
15 lines
545 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { normalizeDeclaredNodeCommands } from "./node-command-policy.js";
|
|
|
|
describe("gateway/node-command-policy", () => {
|
|
it("normalizes declared node commands against the allowlist", () => {
|
|
const allowlist = new Set(["canvas.snapshot", "system.run"]);
|
|
expect(
|
|
normalizeDeclaredNodeCommands({
|
|
declaredCommands: [" canvas.snapshot ", "", "system.run", "system.run", "screen.record"],
|
|
allowlist,
|
|
}),
|
|
).toEqual(["canvas.snapshot", "system.run"]);
|
|
});
|
|
});
|