|
| 1 | +import fs from "node:fs/promises"; |
1 | 2 | import { afterEach, beforeAll, beforeEach, describe, expect, it, vi } from "vitest"; |
2 | 3 | import type { OpenClawConfig } from "../config/types.js"; |
3 | 4 | import { CLI_OUTPUT_MAX_BUFFER } from "./defaults.constants.js"; |
@@ -25,7 +26,11 @@ describe("media-understanding CLI audio entry", () => {
|
25 | 26 | }); |
26 | 27 | |
27 | 28 | it("applies per-request prompt and language overrides to CLI transcription templating", async () => { |
| 29 | +let mediaPath = ""; |
| 30 | + |
28 | 31 | await withAudioFixture("openclaw-cli-audio", async ({ ctx, cache }) => { |
| 32 | +mediaPath = await fs.realpath(ctx.MediaPath); |
| 33 | + |
29 | 34 | await runCliEntry({ |
30 | 35 | capability: "audio", |
31 | 36 | entry: { |
@@ -59,11 +64,10 @@ describe("media-understanding CLI audio entry", () => {
|
59 | 64 | }); |
60 | 65 | }); |
61 | 66 | |
| 67 | +expect(runExecMock).toHaveBeenCalledTimes(1); |
62 | 68 | const [command, args, options] = runExecMock.mock.calls[0] ?? []; |
63 | 69 | expect(command).toBe("mock-transcriber"); |
64 | | -expect(args).toEqual( |
65 | | -expect.arrayContaining(["--prompt", "Focus on names", "--language", "en"]), |
66 | | -); |
| 70 | +expect(args).toEqual(["--prompt", "Focus on names", "--language", "en", "--file", mediaPath]); |
67 | 71 | expect(options).toEqual({ |
68 | 72 | timeoutMs: 60_000, |
69 | 73 | maxBuffer: CLI_OUTPUT_MAX_BUFFER, |
|