Files
openclaw/src/agents/bash-tools.exec.pty.e2e.test.ts

20 lines
661 B
TypeScript
Raw Normal View History

2026-01-17 04:57:04 +00:00
import { afterEach, expect, test } from "vitest";
2026-02-17 14:33:38 +09:00
import { resetProcessRegistryForTests } from "./bash-process-registry.js";
import { createExecTool } from "./bash-tools.exec.js";
2026-01-17 04:57:04 +00:00
afterEach(() => {
resetProcessRegistryForTests();
});
test("exec supports pty output", async () => {
const tool = createExecTool({ allowBackground: false });
const result = await tool.execute("toolcall", {
command: 'node -e "process.stdout.write(String.fromCharCode(111,107))"',
2026-01-17 04:57:04 +00:00
pty: true,
});
expect(result.details.status).toBe("completed");
2026-02-17 15:49:00 +09:00
const text = result.content?.find((item) => item.type === "text")?.text ?? "";
2026-01-17 04:57:04 +00:00
expect(text).toContain("ok");
});