























@@ -1,5 +1,4 @@
11import { afterEach, describe, expect, it, vi } from "vitest";
2-import type { TaskRecord } from "./task-registry.types.js";
32import {
43completeTaskRunByRunId,
54createQueuedTaskRun,
@@ -12,6 +11,7 @@ import {
1211setDetachedTaskDeliveryStatusByRunId,
1312startTaskRunByRunId,
1413} from "./detached-task-runtime.js";
14+import type { TaskRecord } from "./task-registry.types.js";
15151616function createFakeTaskRecord(overrides?: Partial<TaskRecord>): TaskRecord {
1717return {
@@ -46,15 +46,16 @@ describe("detached-task-runtime", () => {
4646taskId: "task-running",
4747runId: "run-running",
4848});
49+const updatedTasks = [runningTask];
49505051const fakeRuntime = {
5152createQueuedTaskRun: vi.fn(() => queuedTask),
5253createRunningTaskRun: vi.fn(() => runningTask),
53-startTaskRunByRunId: vi.fn(() => undefined),
54-recordTaskRunProgressByRunId: vi.fn(() => undefined),
55-completeTaskRunByRunId: vi.fn(() => undefined),
56-failTaskRunByRunId: vi.fn(() => undefined),
57-setDetachedTaskDeliveryStatusByRunId: vi.fn(() => undefined),
54+startTaskRunByRunId: vi.fn(() => updatedTasks),
55+recordTaskRunProgressByRunId: vi.fn(() => updatedTasks),
56+completeTaskRunByRunId: vi.fn(() => updatedTasks),
57+failTaskRunByRunId: vi.fn(() => updatedTasks),
58+setDetachedTaskDeliveryStatusByRunId: vi.fn(() => updatedTasks),
5859};
59606061setDetachedTaskLifecycleRuntime(fakeRuntime);
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。