Files
openclaw/src/config/plugin-web-search-config.test.ts
2026-04-08 08:51:01 +01:00

45 lines
978 B
TypeScript

import { describe, expect, it } from "vitest";
import { resolvePluginWebSearchConfig } from "./plugin-web-search-config.js";
describe("resolvePluginWebSearchConfig", () => {
it("returns the nested plugin webSearch object when present", () => {
expect(
resolvePluginWebSearchConfig(
{
plugins: {
entries: {
brave: {
config: {
webSearch: {
apiKey: "brave-key",
},
},
},
},
},
},
"brave",
),
).toEqual({
apiKey: "brave-key",
});
});
it("ignores non-record plugin config values", () => {
expect(
resolvePluginWebSearchConfig(
{
plugins: {
entries: {
brave: {
config: "nope",
},
},
},
},
"brave",
),
).toBeUndefined();
});
});