diff options
| author | Yordis Prieto <[email protected]> | 2025-08-01 14:14:54 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-01 14:14:54 -0400 |
| commit | 04a1ab38939d89717953d7dabdedb2bb119dca53 (patch) | |
| tree | ca414bc96bee0dfbf7eb745162e1217a18f8538a | |
| parent | e74b4d098b14c8232ca8eed5106291114f339f7d (diff) | |
| download | opencode-04a1ab38939d89717953d7dabdedb2bb119dca53.tar.gz opencode-04a1ab38939d89717953d7dabdedb2bb119dca53.zip | |
chore: enhance bash command tests with config mock and timeout adjustments (#1486)
Signed-off-by: Yordis Prieto <[email protected]>
| -rw-r--r-- | packages/opencode/test/tool/bash.test.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/packages/opencode/test/tool/bash.test.ts b/packages/opencode/test/tool/bash.test.ts index d258c980f..016a6fe9e 100644 --- a/packages/opencode/test/tool/bash.test.ts +++ b/packages/opencode/test/tool/bash.test.ts @@ -19,19 +19,21 @@ Log.init({ print: false }) describe("tool.bash", () => { test("basic", async () => { await App.provide({ cwd: projectRoot }, async () => { - await bash.execute( + const result = await bash.execute( { - command: "cd foo/bar && ls", - description: "List files in foo/bar", + command: "echo 'test'", + description: "Echo test message", }, ctx, ) + expect(result.metadata.exit).toBe(0) + expect(result.metadata.stdout).toContain("test") }) }) - test("cd ../ should fail", async () => { + test("cd ../ should fail outside of project root", async () => { await App.provide({ cwd: projectRoot }, async () => { - expect( + await expect( bash.execute( { command: "cd ../", @@ -39,7 +41,7 @@ describe("tool.bash", () => { }, ctx, ), - ).rejects.toThrow() + ).rejects.toThrow("This command references paths outside of") }) }) }) |
