mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 15:30:39 +00:00
test: preload doctor command in migration suites
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
import "./doctor.fast-path-mocks.js";
|
||||
|
||||
const DOCTOR_MIGRATION_TIMEOUT_MS = 20_000;
|
||||
const { doctorCommand } = await import("./doctor.js");
|
||||
|
||||
describe("doctor command", () => {
|
||||
it("does not add a new gateway auth token while fixing legacy issues on invalid config", async () => {
|
||||
@@ -34,7 +35,6 @@ describe("doctor command", () => {
|
||||
legacyIssues: [{ path: "routing.allowFrom", message: "legacy" }],
|
||||
});
|
||||
|
||||
const { doctorCommand } = await import("./doctor.js");
|
||||
const runtime = createDoctorRuntime();
|
||||
|
||||
migrateLegacyConfig.mockReturnValue({
|
||||
@@ -78,7 +78,6 @@ describe("doctor command", () => {
|
||||
serviceIsLoaded.mockResolvedValueOnce(false);
|
||||
serviceInstall.mockClear();
|
||||
|
||||
const { doctorCommand } = await import("./doctor.js");
|
||||
await doctorCommand(createDoctorRuntime());
|
||||
|
||||
expect(uninstallLegacyGatewayServices).not.toHaveBeenCalled();
|
||||
@@ -108,7 +107,6 @@ describe("doctor command", () => {
|
||||
|
||||
mockDoctorConfigSnapshot();
|
||||
|
||||
const { doctorCommand } = await import("./doctor.js");
|
||||
await doctorCommand(createDoctorRuntime());
|
||||
|
||||
expect(runGatewayUpdate).toHaveBeenCalledWith(expect.objectContaining({ cwd: root }));
|
||||
|
||||
@@ -2,6 +2,7 @@ import { describe, expect, it, vi } from "vitest";
|
||||
import { readConfigFileSnapshot, writeConfigFile } from "./doctor.e2e-harness.js";
|
||||
|
||||
const DOCTOR_MIGRATION_TIMEOUT_MS = 20_000;
|
||||
const { doctorCommand } = await import("./doctor.js");
|
||||
|
||||
describe("doctor command", () => {
|
||||
it(
|
||||
@@ -31,7 +32,6 @@ describe("doctor command", () => {
|
||||
legacyIssues: [],
|
||||
});
|
||||
|
||||
const { doctorCommand } = await import("./doctor.js");
|
||||
const runtime = { log: vi.fn(), error: vi.fn(), exit: vi.fn() };
|
||||
|
||||
await doctorCommand(runtime, { nonInteractive: true, repair: true });
|
||||
|
||||
Reference in New Issue
Block a user