test: preload sandbox explain command module in suite

This commit is contained in:
Peter Steinberger
2026-02-22 15:08:20 +00:00
parent 0b13a0286e
commit c42b0b2dfc

View File

@@ -10,6 +10,8 @@ vi.mock("../config/config.js", async (importOriginal) => {
};
});
const { sandboxExplainCommand } = await import("./sandbox-explain.js");
describe("sandbox explain command", () => {
it("prints JSON shape + fix-it keys", async () => {
mockCfg = {
@@ -25,8 +27,6 @@ describe("sandbox explain command", () => {
session: { store: "/tmp/openclaw-test-sessions-{agentId}.json" },
};
const { sandboxExplainCommand } = await import("./sandbox-explain.js");
const logs: string[] = [];
await sandboxExplainCommand({ json: true, session: "agent:main:main" }, {
log: (msg: string) => logs.push(msg),