Files
moltbot/src/config/logging-max-file-bytes.test.ts
2026-05-08 08:49:19 +01:00

26 lines
641 B
TypeScript

import { describe, expect, it } from "vitest";
import { validateConfigObject } from "./validation.js";
describe("logging.maxFileBytes config", () => {
it("accepts a positive maxFileBytes", () => {
const res = validateConfigObject({
logging: {
maxFileBytes: 1024,
},
});
expect(res.ok).toBe(true);
});
it("rejects non-positive maxFileBytes", () => {
const res = validateConfigObject({
logging: {
maxFileBytes: 0,
},
});
expect(res.ok).toBe(false);
if (!res.ok) {
expect(res.issues.map((issue) => issue.path)).toContain("logging.maxFileBytes");
}
});
});