Download src/agents/bash-tools.exec.pty.e2e.test.ts from shimen/shinclaw: direct link, hf CLI and curl.
- Browser
- Download file 622 Bytes
-
https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/agents/bash-tools.exec.pty.e2e.test.ts
- Command line
-
hf download hf://spaces/shimen/shinclaw/src/agents/bash-tools.exec.pty.e2e.test.ts
-
curl -L -o bash-tools.exec.pty.e2e.test.ts https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/agents/bash-tools.exec.pty.e2e.test.ts
622 Bytes
| import { afterEach, expect, test } from "vitest"; | |
| import { resetProcessRegistryForTests } from "./bash-process-registry"; | |
| import { createExecTool } from "./bash-tools.exec"; | |
| 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))"', | |
| pty: true, | |
| }); | |
| expect(result.details.status).toBe("completed"); | |
| const text = result.content?.[0]?.text ?? ""; | |
| expect(text).toContain("ok"); | |
| }); | |