add test
This commit is contained in:
parent
7d39d84762
commit
89f3963185
38
src/config/config.web-fetch-firecrawl.test.ts
Normal file
38
src/config/config.web-fetch-firecrawl.test.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { describe, expect, it } from "vitest";
|
||||||
|
|
||||||
|
import { MoltbotSchema } from "./zod-schema.js";
|
||||||
|
|
||||||
|
describe("tools.web.fetch.firecrawl config schema", () => {
|
||||||
|
it("accepts firecrawl nested config", () => {
|
||||||
|
const res = MoltbotSchema.safeParse({
|
||||||
|
tools: {
|
||||||
|
web: {
|
||||||
|
fetch: {
|
||||||
|
firecrawl: {
|
||||||
|
enabled: true,
|
||||||
|
baseUrl: "http://localhost:3002",
|
||||||
|
onlyMainContent: true,
|
||||||
|
maxAgeMs: 172800000,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res.success).toBe(true);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("accepts readability config", () => {
|
||||||
|
const res = MoltbotSchema.safeParse({
|
||||||
|
tools: {
|
||||||
|
web: {
|
||||||
|
fetch: {
|
||||||
|
readability: false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(res.success).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue
Block a user