openclaw/src/config/config.skills-entries-config.test.ts
Peter Steinberger 76698ed296 fix: allow custom skill config bag
Co-authored-by: VACInc <3279061+VACInc@users.noreply.github.com>
2026-01-20 15:57:08 +00:00

47 lines
1.0 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { ClawdbotSchema } from "./zod-schema.js";
describe("skills entries config schema", () => {
it("accepts custom fields under config", () => {
const res = ClawdbotSchema.safeParse({
skills: {
entries: {
"custom-skill": {
enabled: true,
config: {
url: "https://example.invalid",
token: "abc123",
},
},
},
},
});
expect(res.success).toBe(true);
});
it("rejects unknown top-level fields", () => {
const res = ClawdbotSchema.safeParse({
skills: {
entries: {
"custom-skill": {
url: "https://example.invalid",
},
},
},
});
expect(res.success).toBe(false);
if (res.success) return;
expect(
res.error.issues.some(
(issue) =>
issue.path.join(".") === "skills.entries.custom-skill" &&
issue.message.toLowerCase().includes("unrecognized"),
),
).toBe(true);
});
});