test: migrate suites to e2e coverage layout

This commit is contained in:
Peter Steinberger
2026-02-13 14:28:12 +00:00
parent f5160ca6be
commit 9131b22a28
329 changed files with 1455 additions and 1077 deletions

View File

@@ -0,0 +1,21 @@
import path from "node:path";
import { afterEach, describe, expect, it, vi } from "vitest";
afterEach(() => {
vi.unstubAllEnvs();
vi.resetModules();
});
describe("DEFAULT_AGENT_WORKSPACE_DIR", () => {
it("uses OPENCLAW_HOME at module import time", async () => {
const home = path.join(path.sep, "srv", "openclaw-home");
vi.stubEnv("OPENCLAW_HOME", home);
vi.stubEnv("HOME", path.join(path.sep, "home", "other"));
vi.resetModules();
const mod = await import("./workspace.js");
expect(mod.DEFAULT_AGENT_WORKSPACE_DIR).toBe(
path.join(path.resolve(home), ".openclaw", "workspace"),
);
});
});