Files
openclaw/src/config/logging.test.ts
Tak Hoffman d9e8e8ac15 fix: resolve live config paths in status and gateway metadata (#39952)
* 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
2026-03-08 09:59:32 -05:00

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");
});
});