fix: repair pre-existing engine test failures from missing pi-ai mock

Add @mariozechner/pi-ai mock to restart.integration.test.ts and
project-runtime.test.ts to fix module linking errors. Fix call count
assertions in executor and restart tests to account for the
retry-without-task_done behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-04 13:59:08 -07:00
parent dd0b53c358
commit aac5297154
3 changed files with 40 additions and 13 deletions

View File

@@ -1,4 +1,18 @@
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
vi.mock("@mariozechner/pi-ai", () => ({
Type: {
Object: (props: Record<string, unknown>) => ({ type: "object", properties: props }),
String: (opts?: unknown) => ({ type: "string", ...((opts as object) ?? {}) }),
Number: (opts?: unknown) => ({ type: "number", ...((opts as object) ?? {}) }),
Boolean: (opts?: unknown) => ({ type: "boolean", ...((opts as object) ?? {}) }),
Optional: (schema: unknown) => schema,
Array: (schema: unknown, opts?: unknown) => ({ type: "array", items: schema, ...((opts as object) ?? {}) }),
Union: (schemas: unknown[], opts?: unknown) => ({ anyOf: schemas, ...((opts as object) ?? {}) }),
Literal: (value: unknown) => ({ const: value }),
},
}));
import { EventEmitter } from "node:events";
import type { Task, TaskStore, CentralCore } from "@fusion/core";
import type { Scheduler } from "../scheduler.js";