ef415e863b
- Replaced SettingsManager class with new Settings singleton providing synchronous get/set API and background persistence.
- Introduced settings-schema.ts as single source of truth for all configuration definitions with 100+ settings organized into logical groups.
- Migrated from method-based settings access (getTheme(), setTheme()) to path-based access using dot notation (settings.get('theme'), settings.set('theme', value)).
- Removed 2035-line settings-manager.ts file and replaced with modular settings.ts (693 lines) and settings-schema.ts (836 lines) for improved maintainability.
- Unified settings schema into single source of truth eliminating duplicate definitions across settings-defs.ts and settings-manager.ts.
25 lines
877 B
TypeScript
25 lines
877 B
TypeScript
import { describe, expect, it } from "bun:test";
|
|
import { Settings } from "@oh-my-pi/pi-coding-agent/config/settings";
|
|
|
|
describe("Settings python settings", () => {
|
|
it("defaults to both and session", () => {
|
|
const settings = Settings.isolated({});
|
|
|
|
expect(settings.get("python.toolMode")).toBe("both");
|
|
expect(settings.get("python.kernelMode")).toBe("session");
|
|
});
|
|
|
|
it("persists python tool and kernel modes", () => {
|
|
const settings = Settings.isolated({});
|
|
|
|
settings.set("python.toolMode", "bash-only");
|
|
settings.set("python.kernelMode", "per-call");
|
|
|
|
expect(settings.get("python.toolMode")).toBe("bash-only");
|
|
expect(settings.get("python.kernelMode")).toBe("per-call");
|
|
const serialized = settings.serialize();
|
|
expect((serialized.python as any)?.toolMode).toBe("bash-only");
|
|
expect((serialized.python as any)?.kernelMode).toBe("per-call");
|
|
});
|
|
});
|