Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

test(mcp): delete the project only once the waiting transcription has found it

EtienneLescot1477209cbbed
diff --git a/electron/mcp/transcribe-tool.test.ts b/electron/mcp/transcribe-tool.test.ts
index 8f3b443c6..85e4a635b 100644
--- a/electron/mcp/transcribe-tool.test.ts
+++ b/electron/mcp/transcribe-tool.test.ts
@@ -203,7 +203,11 @@ describe("transcribe, on a project's file", () => {
);
const first = run(TRANSCRIBE_TOOL, { projectId: "proj_1" });
await vi.waitFor(() => expect(running).toHaveLength(1));
+ const reads = vi.spyOn(projects, "getProjectForUpdate");
const second = run(TRANSCRIBE_TOOL, { projectId: "proj_2" });
+ // Deleted once the call has found the project, while it waits for Whisper.
+ await vi.waitFor(() => expect(reads).toHaveBeenCalledWith("proj_2"));
+ await reads.mock.results.at(-1)?.value;
await projects.deleteProject("proj_2");
running.shift()?.(SPEECH);
await first;