mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-14 18:51:04 +00:00
45 lines
978 B
TypeScript
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();
|
|
});
|
|
});
|