Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Tests: parse the speech helpers' JSON lines; keep the rest of vps-computer in the idle mock
milind-soni4346e3ce5855
diff --git a/electron/speech-helper-windows.test.mjs b/electron/speech-helper-windows.test.mjsindex a7deaaeaad..afe24a087c 100644--- a/electron/speech-helper-windows.test.mjs+++ b/electron/speech-helper-windows.test.mjs@@ -79,11 +79,11 @@ describe.skipIf(!found || process.platform !== "win32")("Windows speech helpers};const heard = helper("param([int]$EndpointMs = 0)\nSend-Line @{ partial = $false; text = (Join-Text 'from' 'onecore') }\nexit 0\n");expect(heard.status).toBe(0);- expect(heard.stdout.trim()).toBe(JSON.stringify({ partial: false, text: "from onecore" }));+ expect(JSON.parse(heard.stdout.trim())).toEqual({ partial: false, text: "from onecore" });if (installed === 0) {const missing = helper("param([int]$EndpointMs = 0)\nexit 3\n");expect(missing.status).toBe(1);- expect(missing.stdout.trim()).toBe(JSON.stringify({ error: "speech-language-missing" }));+ expect(JSON.parse(missing.stdout.trim())).toEqual({ error: "speech-language-missing" });}} finally {rmSync(dir, { recursive: true, force: true });diff --git a/server/host/vps-idle.test.ts b/server/host/vps-idle.test.tsindex c3d1fbb735..c14c4fe5ce 100644--- a/server/host/vps-idle.test.ts+++ b/server/host/vps-idle.test.ts@@ -1,7 +1,8 @@import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";const viewer = vi.hoisted(() => ({ open: false }));-vi.mock("../vps-computer.ts", () => ({+vi.mock("../vps-computer.ts", async (importOriginal) => ({+ ...await importOriginal<typeof import("../vps-computer.ts")>(),vpsDesktopConnection: vi.fn(() => (viewer.open ? { port: 5901, password: "p", live: () => true, retain: () => () => {} } : undefined)),vpsComputerAction: vi.fn(async (_action: string, _cfg: unknown, _botId: string, _runner: unknown, shouldStop?: () => boolean) =>({ container: shouldStop && !shouldStop() ? "running" : "stopped" })),