Files
openclaw/src/plugins/logger.test.ts
2026-06-04 04:57:48 -04:00

24 lines
623 B
TypeScript

/** Tests plugin logger formatting and diagnostic forwarding behavior. */
import { describe, expect, it, vi } from "vitest";
import { createPluginLoaderLogger } from "./logger.js";
describe("plugins/logger", () => {
it.each([
["info", "i"],
["warn", "w"],
["error", "e"],
["debug", "d"],
] as const)("forwards %s", (method, value) => {
const methods = {
info: vi.fn(),
warn: vi.fn(),
error: vi.fn(),
debug: vi.fn(),
};
const logger = createPluginLoaderLogger(methods);
logger[method]?.(value);
expect(methods[method]).toHaveBeenCalledWith(value);
});
});