Skip to content

Commit dae0168

Browse files
committed
test: fixture cleanup
1 parent edfe2e4 commit dae0168

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/opencode/test/preload.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
import os from "os"
44
import path from "path"
55
import fs from "fs/promises"
6+
import fsSync from "fs"
7+
import { afterAll } from "bun:test"
68

79
const dir = path.join(os.tmpdir(), "opencode-test-data-" + process.pid)
810
await fs.mkdir(dir, { recursive: true })
11+
afterAll(() => {
12+
fsSync.rmSync(dir, { recursive: true, force: true })
13+
})
914
process.env["XDG_DATA_HOME"] = path.join(dir, "share")
1015
process.env["XDG_CACHE_HOME"] = path.join(dir, "cache")
1116
process.env["XDG_CONFIG_HOME"] = path.join(dir, "config")

0 commit comments

Comments
 (0)