refactor: deduplicate shared helpers and test setup

This commit is contained in:
Peter Steinberger
2026-02-23 20:40:38 +00:00
parent 1f5e6444ee
commit 75423a00d6
33 changed files with 999 additions and 1112 deletions

View File

@@ -8,7 +8,7 @@ import {
unsetConfigValueAtPath,
} from "./config-paths.js";
import { readConfigFileSnapshot, validateConfigObject } from "./config.js";
import { withTempHome } from "./test-helpers.js";
import { buildWebSearchProviderConfig, withTempHome } from "./test-helpers.js";
import { OpenClawSchema } from "./zod-schema.js";
describe("$schema key in config (#14998)", () => {
@@ -51,41 +51,17 @@ describe("ui.seamColor", () => {
});
describe("web search provider config", () => {
it("accepts perplexity provider and config", () => {
const res = validateConfigObject({
tools: {
web: {
search: {
enabled: true,
provider: "perplexity",
perplexity: {
apiKey: "test-key",
baseUrl: "https://api.perplexity.ai",
model: "perplexity/sonar-pro",
},
},
},
},
});
expect(res.ok).toBe(true);
});
it("accepts kimi provider and config", () => {
const res = validateConfigObject({
tools: {
web: {
search: {
provider: "kimi",
kimi: {
apiKey: "test-key",
baseUrl: "https://api.moonshot.ai/v1",
model: "moonshot-v1-128k",
},
},
const res = validateConfigObject(
buildWebSearchProviderConfig({
provider: "kimi",
providerConfig: {
apiKey: "test-key",
baseUrl: "https://api.moonshot.ai/v1",
model: "moonshot-v1-128k",
},
},
});
}),
);
expect(res.ok).toBe(true);
});