mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 04:31:10 +00:00
test: align latest main runtime harnesses
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { getTaskFlowById, resetTaskFlowRegistryForTests } from "../../tasks/task-flow-registry.js";
|
||||
import { getTaskById, resetTaskRegistryForTests } from "../../tasks/task-registry.js";
|
||||
import {
|
||||
getTaskById,
|
||||
resetTaskRegistryDeliveryRuntimeForTests,
|
||||
resetTaskRegistryForTests,
|
||||
setTaskRegistryDeliveryRuntimeForTests,
|
||||
} from "../../tasks/task-registry.js";
|
||||
import { createRuntimeTaskFlow } from "./runtime-taskflow.js";
|
||||
|
||||
const hoisted = vi.hoisted(() => {
|
||||
@@ -14,10 +19,6 @@ const hoisted = vi.hoisted(() => {
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("../../tasks/task-registry-delivery-runtime.js", () => ({
|
||||
sendMessage: hoisted.sendMessageMock,
|
||||
}));
|
||||
|
||||
vi.mock("../../acp/control-plane/manager.js", () => ({
|
||||
getAcpSessionManager: () => ({
|
||||
cancelSession: hoisted.cancelSessionMock,
|
||||
@@ -29,12 +30,19 @@ vi.mock("../../agents/subagent-control.js", () => ({
|
||||
}));
|
||||
|
||||
afterEach(() => {
|
||||
resetTaskRegistryDeliveryRuntimeForTests();
|
||||
resetTaskRegistryForTests();
|
||||
resetTaskFlowRegistryForTests({ persist: false });
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
|
||||
describe("runtime TaskFlow", () => {
|
||||
beforeEach(() => {
|
||||
setTaskRegistryDeliveryRuntimeForTests({
|
||||
sendMessage: hoisted.sendMessageMock,
|
||||
});
|
||||
});
|
||||
|
||||
it("binds managed TaskFlow operations to a session key", () => {
|
||||
const runtime = createRuntimeTaskFlow();
|
||||
const taskFlow = runtime.bindSession({
|
||||
|
||||
Reference in New Issue
Block a user