refactor(doctor): type legacy migration fixtures

This commit is contained in:
Peter Steinberger
2026-03-08 02:08:23 +00:00
parent 44e7c1142e
commit a679049c38

View File

@@ -3,6 +3,7 @@ import os from "node:os";
import path from "node:path";
import { afterEach, beforeEach, vi } from "vitest";
import type { MockFn } from "../test-utils/vitest-mock-fn.js";
import type { LegacyStateDetection } from "./doctor-state-migrations.js";
let originalIsTTY: boolean | undefined;
let originalStateDir: string | undefined;
@@ -113,7 +114,7 @@ export const autoMigrateLegacyStateDir = vi.fn().mockResolvedValue({
function createLegacyStateMigrationDetectionResult(params?: {
hasLegacySessions?: boolean;
preview?: string[];
}) {
}): LegacyStateDetection {
return {
targetAgentId: "main",
targetMainKey: "main",
@@ -139,9 +140,8 @@ function createLegacyStateMigrationDetectionResult(params?: {
hasLegacy: false,
},
pairingAllowFrom: {
legacyTelegramPath: "/tmp/oauth/telegram-allowFrom.json",
targetTelegramPath: "/tmp/oauth/telegram-default-allowFrom.json",
hasLegacyTelegram: false,
copyPlans: [],
},
preview: params?.preview ?? [],
};