mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-19 14:00:51 +00:00
* fix: resolve live config paths in status and gateway metadata * fix: resolve remaining runtime config path references * test: cover gateway config.set config path response
26 lines
781 B
TypeScript
26 lines
781 B
TypeScript
import { describe, expect, it, vi } from "vitest";
|
|
|
|
const mocks = vi.hoisted(() => ({
|
|
createConfigIO: vi.fn().mockReturnValue({
|
|
configPath: "/tmp/openclaw-dev/openclaw.json",
|
|
}),
|
|
}));
|
|
|
|
vi.mock("./io.js", () => ({
|
|
createConfigIO: mocks.createConfigIO,
|
|
}));
|
|
|
|
import { formatConfigPath, logConfigUpdated } from "./logging.js";
|
|
|
|
describe("config logging", () => {
|
|
it("formats the live config path when no explicit path is provided", () => {
|
|
expect(formatConfigPath()).toBe("/tmp/openclaw-dev/openclaw.json");
|
|
});
|
|
|
|
it("logs the live config path when no explicit path is provided", () => {
|
|
const runtime = { log: vi.fn() };
|
|
logConfigUpdated(runtime as never);
|
|
expect(runtime.log).toHaveBeenCalledWith("Updated /tmp/openclaw-dev/openclaw.json");
|
|
});
|
|
});
|