fix(tests): iteration 16

This commit is contained in:
Mohamed Boudra
2026-03-13 13:43:34 +07:00
parent 40ebd1b730
commit e8b55eccab
8 changed files with 70 additions and 55 deletions
@@ -284,23 +284,9 @@ describe("TerminalManager - Command Execution", () => {
5000
);
// First command
await manager.sendTextToCommand(
execResult.commandId,
"x = 5",
true,
{ lines: 50, maxWait: 2000 }
);
await manager.sendTextToCommand(execResult.commandId, "x = 5", true);
await manager.sendTextToCommand(execResult.commandId, "y = 3", true);
// Second command
await manager.sendTextToCommand(
execResult.commandId,
"y = 3",
true,
{ lines: 50, maxWait: 2000 }
);
// Third command - use variables
const output = await manager.sendTextToCommand(
execResult.commandId,
"print(x + y)",
@@ -449,24 +435,16 @@ describe("TerminalManager - Command Execution", () => {
expect(execResult.output).toContain(">"); // Node prompt
expect(execResult.isDead).toBe(false);
// Execute JavaScript
await manager.sendTextToCommand(
execResult.commandId,
"const x = [1, 2, 3]",
true,
{ lines: 50, maxWait: 2000 }
);
await manager.sendTextToCommand(execResult.commandId, "const x = [1, 2, 3]", true);
const output2 = await manager.sendTextToCommand(
execResult.commandId,
"x.map(n => n * 2)",
"console.log(x.map(n => n * 2).join(','))",
true,
{ lines: 50, maxWait: 2000 }
);
expect(output2).toContain("2");
expect(output2).toContain("4");
expect(output2).toContain("6");
expect(output2).toContain("2,4,6");
// Exit
await manager.sendTextToCommand(execResult.commandId, ".exit", true);
@@ -1,4 +1,3 @@
import path from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, test } from "vitest";
@@ -26,7 +25,9 @@ describe("resolveVoiceMcpBridgeFromRuntime", () => {
});
test("uses explicit script override when provided", () => {
const explicitScriptPath = path.resolve(process.cwd(), "scripts/mcp-stdio-socket-bridge-cli.mjs");
const explicitScriptPath = fileURLToPath(
new URL("../../scripts/mcp-stdio-socket-bridge-cli.mjs", bootstrapModuleUrl)
);
const result = resolveVoiceMcpBridgeFromRuntime({
bootstrapModuleUrl,
@@ -9,6 +9,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import pino from "pino";
import { createVoiceMcpSocketBridgeManager } from "./voice-mcp-bridge.js";
import { resolveVoiceMcpBridgeScriptPath } from "./voice-mcp-bridge-command.js";
describe("voice MCP bridge", () => {
test("proxies stdio MCP bytes through per-agent unix socket bridge", async () => {
@@ -54,12 +55,12 @@ describe("voice MCP bridge", () => {
const socketPath = await bridgeManager.ensureBridgeForCaller(callerAgentId);
const bridgeScript = path.resolve(process.cwd(), "scripts/mcp-stdio-socket-bridge-cli.mjs");
const transport = new StdioClientTransport({
command: process.execPath,
args: [
bridgeScript,
resolveVoiceMcpBridgeScriptPath({
bootstrapModuleUrl: import.meta.url,
}),
"--socket",
socketPath,
],