import { test } from "node:test"; import assert from "node:assert/strict"; import { getTranscriptionApp } from "./transcriptionApps"; const input = { audioFile: "audio.wav", outputBase: "transcript.tmp", config: { model: "/m.gguf" } }; test("parakeet keeps its words only when asked", () => { const app = getTranscriptionApp("parakeet"); assert.ok(!app.build(input).argv.includes("--words")); const asked = app.build({ ...input, words: true }).argv; assert.ok(asked.includes("--words")); // The audio file stays the last argument: the wrapper reads it positionally. assert.equal(asked.at(-1), "audio.wav"); }); test("an engine with no words to give ignores the ask", () => { for (const id of ["whisper.cpp", "chough"]) { let app; try { app = getTranscriptionApp(id); } catch { continue; } if (app.id !== id) continue; assert.deepEqual(app.build({ ...input, words: true }).argv, app.build(input).argv); } });