mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 18:14:31 +00:00
test: make boot-md startup integration workspace assertion cross-platform
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||||
|
import { resolveAgentWorkspaceDir } from "../../../agents/agent-scope.js";
|
||||||
import type { CliDeps } from "../../../cli/deps.js";
|
import type { CliDeps } from "../../../cli/deps.js";
|
||||||
import type { OpenClawConfig } from "../../../config/config.js";
|
import type { OpenClawConfig } from "../../../config/config.js";
|
||||||
|
|
||||||
@@ -43,14 +44,17 @@ describe("boot-md startup hook integration", () => {
|
|||||||
const event = createInternalHookEvent("gateway", "startup", "gateway:startup", { cfg, deps });
|
const event = createInternalHookEvent("gateway", "startup", "gateway:startup", { cfg, deps });
|
||||||
await triggerInternalHook(event);
|
await triggerInternalHook(event);
|
||||||
|
|
||||||
|
const mainWorkspaceDir = resolveAgentWorkspaceDir(cfg, "main");
|
||||||
|
const opsWorkspaceDir = resolveAgentWorkspaceDir(cfg, "ops");
|
||||||
|
|
||||||
expect(runBootOnce).toHaveBeenCalledTimes(2);
|
expect(runBootOnce).toHaveBeenCalledTimes(2);
|
||||||
expect(runBootOnce).toHaveBeenNthCalledWith(
|
expect(runBootOnce).toHaveBeenNthCalledWith(
|
||||||
1,
|
1,
|
||||||
expect.objectContaining({ cfg, deps, workspaceDir: "/ws/main", agentId: "main" }),
|
expect.objectContaining({ cfg, deps, workspaceDir: mainWorkspaceDir, agentId: "main" }),
|
||||||
);
|
);
|
||||||
expect(runBootOnce).toHaveBeenNthCalledWith(
|
expect(runBootOnce).toHaveBeenNthCalledWith(
|
||||||
2,
|
2,
|
||||||
expect.objectContaining({ cfg, deps, workspaceDir: "/ws/ops", agentId: "ops" }),
|
expect.objectContaining({ cfg, deps, workspaceDir: opsWorkspaceDir, agentId: "ops" }),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user