test: tighten audio transcode ffmpeg assertion · openclaw/openclaw@f11ac1a
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -43,10 +43,30 @@ describe("transcodeAudioBufferToOpus", () => {
|
43 | 43 | }), |
44 | 44 | ).resolves.toEqual(Buffer.from("opus-output")); |
45 | 45 | |
46 | | -expect(runFfmpegMock).toHaveBeenCalledWith( |
47 | | -expect.arrayContaining(["-c:a", "libopus", "-b:a", "64k", "-ar", "48000", "-ac", "1"]), |
| 46 | +expect(runFfmpegMock).toHaveBeenCalledTimes(1); |
| 47 | +expect(runFfmpegMock.mock.calls[0]).toStrictEqual([ |
| 48 | +[ |
| 49 | +"-hide_banner", |
| 50 | +"-loglevel", |
| 51 | +"error", |
| 52 | +"-y", |
| 53 | +"-i", |
| 54 | +capturedInputPath, |
| 55 | +"-vn", |
| 56 | +"-sn", |
| 57 | +"-dn", |
| 58 | +"-c:a", |
| 59 | +"libopus", |
| 60 | +"-b:a", |
| 61 | +"64k", |
| 62 | +"-ar", |
| 63 | +"48000", |
| 64 | +"-ac", |
| 65 | +"1", |
| 66 | +capturedOutputPath, |
| 67 | +], |
48 | 68 | { timeoutMs: 1234 }, |
49 | | -); |
| 69 | +]); |
50 | 70 | const tempRoot = realpathSync(resolvePreferredOpenClawTmpDir()); |
51 | 71 | expect(capturedInputPath?.startsWith(path.join(tempRoot, "tts-test-"))).toBe(true); |
52 | 72 | expect(capturedInputPath ? existsSync(capturedInputPath) : true).toBe(false); |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。