remove stale web access override

This commit is contained in:
Advait Paliwal
2026-04-10 10:20:31 -07:00
parent 5b9362918e
commit 4137a29507
13 changed files with 115 additions and 3627 deletions

View File

@@ -9,6 +9,7 @@ import {
getPiWebAccessStatus,
getPiWebSearchConfigPath,
loadPiWebAccessConfig,
savePiWebAccessConfig,
} from "../src/pi/web-access.js";
test("loadPiWebAccessConfig returns empty config when Pi web config is missing", () => {
@@ -22,6 +23,26 @@ test("getPiWebSearchConfigPath respects FEYNMAN_HOME semantics", () => {
assert.equal(getPiWebSearchConfigPath("/tmp/custom-home"), "/tmp/custom-home/.feynman/web-search.json");
});
test("savePiWebAccessConfig merges updates and deletes undefined values", () => {
const root = mkdtempSync(join(tmpdir(), "feynman-pi-web-"));
const configPath = getPiWebSearchConfigPath(root);
savePiWebAccessConfig({
provider: "perplexity",
searchProvider: "perplexity",
perplexityApiKey: "pplx_...",
}, configPath);
savePiWebAccessConfig({
provider: undefined,
searchProvider: undefined,
route: undefined,
}, configPath);
assert.deepEqual(loadPiWebAccessConfig(configPath), {
perplexityApiKey: "pplx_...",
});
});
test("getPiWebAccessStatus reads Pi web-access config directly", () => {
const root = mkdtempSync(join(tmpdir(), "feynman-pi-web-"));
const configPath = getPiWebSearchConfigPath(root);