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
7 changes: 6 additions & 1 deletion packages/sandbox/test/container.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { describe, it, expect } from "vitest";
import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { isDockerAvailable, resolveDockerPath, SandboxContainer } from "../src/container.js";

describe("SandboxContainer", () => {
Expand All @@ -24,8 +27,9 @@ describe("SandboxContainer", () => {
return;
}

const workspacePath = await fs.mkdtemp(path.join(os.tmpdir(), "argus-sandbox-test-"));
const container = new SandboxContainer({
workspacePath: process.cwd(),
workspacePath,
timeoutMs: 30000,
});

Expand All @@ -39,6 +43,7 @@ describe("SandboxContainer", () => {
expect(res.stdout).toContain("argus-sandbox-ok");
} finally {
await container.destroy();
await fs.rm(workspacePath, { recursive: true, force: true });
}
}, 60000);
});
Loading