summaryrefslogtreecommitdiffhomepage
path: root/packages
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2025-11-19 14:38:12 -0600
committerAiden Cline <[email protected]>2025-11-19 14:38:12 -0600
commite4e6096510a817c0eaff28ef20eb94ce393d488c (patch)
treeb2d490b20827fc78966b552e83ad898f3cd36394 /packages
parentc472734933afb72db4f31529fd1f03ef1487a6c0 (diff)
downloadopencode-e4e6096510a817c0eaff28ef20eb94ce393d488c.tar.gz
opencode-e4e6096510a817c0eaff28ef20eb94ce393d488c.zip
ignore: fix hanging test
Diffstat (limited to 'packages')
-rw-r--r--packages/opencode/test/tool/bash.test.ts22
1 files changed, 12 insertions, 10 deletions
diff --git a/packages/opencode/test/tool/bash.test.ts b/packages/opencode/test/tool/bash.test.ts
index 2919ccb02..02adc9b35 100644
--- a/packages/opencode/test/tool/bash.test.ts
+++ b/packages/opencode/test/tool/bash.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, test } from "bun:test"
import path from "path"
import { BashTool } from "../../src/tool/bash"
import { Instance } from "../../src/project/instance"
+import { Permission } from "../../src/permission"
const ctx = {
sessionID: "test",
@@ -33,19 +34,20 @@ describe("tool.bash", () => {
})
})
- test("cd ../ should fail outside of project root", async () => {
+ test("cd ../ should ask for permission for external directory", async () => {
await Instance.provide({
directory: projectRoot,
fn: async () => {
- expect(
- bash.execute(
- {
- command: "cd ../",
- description: "Try to cd to parent directory",
- },
- ctx,
- ),
- ).rejects.toThrow("This command references paths outside of")
+ bash.execute(
+ {
+ command: "cd ../",
+ description: "Try to cd to parent directory",
+ },
+ ctx,
+ )
+ // Give time for permission to be asked
+ await new Promise((resolve) => setTimeout(resolve, 100))
+ expect(Permission.pending()[ctx.sessionID]).toBeDefined()
},
})
})