mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-27 20:18:38 +00:00
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 7533b85156
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com>
Co-authored-by: shakkernerd <165377636+shakkernerd@users.noreply.github.com>
Reviewed-by: @shakkernerd
41 lines
952 B
TypeScript
41 lines
952 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { OpenClawSchema } from "./zod-schema.js";
|
|
|
|
describe("OpenClawSchema cron retention and run-log validation", () => {
|
|
it("accepts valid cron.sessionRetention and runLog values", () => {
|
|
expect(() =>
|
|
OpenClawSchema.parse({
|
|
cron: {
|
|
sessionRetention: "1h30m",
|
|
runLog: {
|
|
maxBytes: "5mb",
|
|
keepLines: 2500,
|
|
},
|
|
},
|
|
}),
|
|
).not.toThrow();
|
|
});
|
|
|
|
it("rejects invalid cron.sessionRetention", () => {
|
|
expect(() =>
|
|
OpenClawSchema.parse({
|
|
cron: {
|
|
sessionRetention: "abc",
|
|
},
|
|
}),
|
|
).toThrow(/sessionRetention|duration/i);
|
|
});
|
|
|
|
it("rejects invalid cron.runLog.maxBytes", () => {
|
|
expect(() =>
|
|
OpenClawSchema.parse({
|
|
cron: {
|
|
runLog: {
|
|
maxBytes: "wat",
|
|
},
|
|
},
|
|
}),
|
|
).toThrow(/runLog|maxBytes|size/i);
|
|
});
|
|
});
|