mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 02:21:25 +00:00
20 lines
658 B
TypeScript
20 lines
658 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { resolveSkillInvocationPolicy } from "./frontmatter.js";
|
|
|
|
describe("resolveSkillInvocationPolicy", () => {
|
|
it("defaults to enabled behaviors", () => {
|
|
const policy = resolveSkillInvocationPolicy({});
|
|
expect(policy.userInvocable).toBe(true);
|
|
expect(policy.disableModelInvocation).toBe(false);
|
|
});
|
|
|
|
it("parses frontmatter boolean strings", () => {
|
|
const policy = resolveSkillInvocationPolicy({
|
|
"user-invocable": "no",
|
|
"disable-model-invocation": "yes",
|
|
});
|
|
expect(policy.userInvocable).toBe(false);
|
|
expect(policy.disableModelInvocation).toBe(true);
|
|
});
|
|
});
|