mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
refactor(doctor): type legacy migration fixtures
This commit is contained in:
@@ -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 ?? [],
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user