Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/opencode/test/session/export.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ import { LLMTrace } from "../../src/session/llm-trace"
const projectRoot = path.join(__dirname, "../..")
void Log.init({ print: false })

async function removeSessionProjectDirectory(dir: string) {
await fs.rm(dir, {
recursive: true,
force: true,
maxRetries: process.platform === "win32" ? 30 : 5,
retryDelay: 100,
})
}

describe("Export.session", () => {
test("getRuntimeNamespace returns 'pawwork' or 'opencode'", () => {
expect(["pawwork", "opencode"]).toContain(getRuntimeNamespace())
Expand Down Expand Up @@ -192,7 +201,7 @@ describe("Export.session", () => {
})

try {
await fs.rm(sessionProject.path, { recursive: true, force: true })
await removeSessionProjectDirectory(sessionProject.path)
await Instance.provide({
directory: currentProject.path,
fn: async () => {
Expand Down Expand Up @@ -262,7 +271,7 @@ describe("Export.session", () => {
})

await Config.invalidate(true)
await fs.rm(sessionProject.path, { recursive: true, force: true })
await removeSessionProjectDirectory(sessionProject.path)
await Instance.provide({
directory: currentProject.path,
fn: async () => {
Expand Down
Loading