Skip to content

Commit 050f99e

Browse files
authored
test: make process cwd check cross-platform (#16594)
1 parent 23ed652 commit 050f99e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/opencode/test/util/process.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { describe, expect, test } from "bun:test"
22
import { Process } from "../../src/util/process"
3+
import { tmpdir } from "../fixture/fixture"
34

45
function node(script: string) {
56
return [process.execPath, "-e", script]
@@ -58,10 +59,11 @@ describe("util.process", () => {
5859
}, 3000)
5960

6061
test("uses cwd when spawning commands", async () => {
62+
await using tmp = await tmpdir()
6163
const out = await Process.run(node("process.stdout.write(process.cwd())"), {
62-
cwd: "/tmp",
64+
cwd: tmp.path,
6365
})
64-
expect(out.stdout.toString()).toBe("/tmp")
66+
expect(out.stdout.toString()).toBe(tmp.path)
6567
})
6668

6769
test("merges environment overrides", async () => {

0 commit comments

Comments
 (0)