mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-02 12:51:34 +00:00
34 lines
888 B
TypeScript
34 lines
888 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { VOICE_CALL_CLI_DESCRIPTOR } from "./cli-output-mode.js";
|
|
|
|
const isMachineOutput = VOICE_CALL_CLI_DESCRIPTOR.machineOutput;
|
|
|
|
describe("voice-call CLI output mode", () => {
|
|
it.each([
|
|
"call",
|
|
"continue",
|
|
"dtmf",
|
|
"end",
|
|
"expose",
|
|
"latency",
|
|
"speak",
|
|
"start",
|
|
"status",
|
|
"tail",
|
|
])("detects %s as machine output", (command) => {
|
|
expect(isMachineOutput({ argv: ["node", "openclaw", "voicecall", command] })).toBe(true);
|
|
});
|
|
|
|
it("leaves setup human-readable without --json", () => {
|
|
expect(isMachineOutput({ argv: ["node", "openclaw", "voicecall", "setup"] })).toBe(false);
|
|
});
|
|
|
|
it("accepts a post-root log level", () => {
|
|
expect(
|
|
isMachineOutput({
|
|
argv: ["node", "openclaw", "voicecall", "--log-level", "debug", "status"],
|
|
}),
|
|
).toBe(true);
|
|
});
|
|
});
|