mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 11:21:07 +00:00
23 lines
549 B
TypeScript
23 lines
549 B
TypeScript
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);
|
|
});
|
|
});
|