mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 02:57:27 +00:00
29 lines
682 B
TypeScript
29 lines
682 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { OpenClawSchema } from "./zod-schema.js";
|
|
|
|
describe("OpenClawSchema talk validation", () => {
|
|
it("accepts a positive integer talk.silenceTimeoutMs", () => {
|
|
expect(() =>
|
|
OpenClawSchema.parse({
|
|
talk: {
|
|
silenceTimeoutMs: 1500,
|
|
},
|
|
}),
|
|
).not.toThrow();
|
|
});
|
|
|
|
it.each([
|
|
["boolean", true],
|
|
["string", "1500"],
|
|
["float", 1500.5],
|
|
])("rejects %s talk.silenceTimeoutMs", (_label, value) => {
|
|
expect(() =>
|
|
OpenClawSchema.parse({
|
|
talk: {
|
|
silenceTimeoutMs: value,
|
|
},
|
|
}),
|
|
).toThrow(/silenceTimeoutMs|number|integer/i);
|
|
});
|
|
});
|