mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
test: fixture cleanup
This commit is contained in:
parent
edfe2e4f1c
commit
dae0168ed8
1 changed files with 5 additions and 0 deletions
|
|
@ -3,9 +3,14 @@
|
|||
import os from "os"
|
||||
import path from "path"
|
||||
import fs from "fs/promises"
|
||||
import fsSync from "fs"
|
||||
import { afterAll } from "bun:test"
|
||||
|
||||
const dir = path.join(os.tmpdir(), "opencode-test-data-" + process.pid)
|
||||
await fs.mkdir(dir, { recursive: true })
|
||||
afterAll(() => {
|
||||
fsSync.rmSync(dir, { recursive: true, force: true })
|
||||
})
|
||||
process.env["XDG_DATA_HOME"] = path.join(dir, "share")
|
||||
process.env["XDG_CACHE_HOME"] = path.join(dir, "cache")
|
||||
process.env["XDG_CONFIG_HOME"] = path.join(dir, "config")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue