Spracherkennung für: .ts vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]
import { describe, expect, it, vi } from "vitest";
import type { OpenClawConfig } from "../config/types.openclaw.js";
import type { DoctorPrompter } from "./doctor-prompter.js";
const authProfileMocks = vi.hoisted(() => ({
ensureAuthProfileStore: vi.fn(() => {
throw new Error("unexpected auth profile load");
}),
hasAnyAuthProfileStoreSource: vi.fn(() => false),
resolveApiKeyForProfile: vi.fn(),
resolveProfileUnusableUntilForDisplay: vi.fn(),
}));
vi.mock("../agents/auth-profiles.js", () => ({
ensureAuthProfileStore: authProfileMocks.ensureAuthProfileStore,
hasAnyAuthProfileStoreSource: authProfileMocks.hasAnyAuthProfileStoreSource,
resolveApiKeyForProfile: authProfileMocks.resolveApiKeyForProfile,
resolveProfileUnusableUntilForDisplay: authProfileMocks.resolveProfileUnusableUntilForDisplay,
}));
vi.mock("../terminal/note.js", () => ({ note: vi.fn() }));
import { noteAuthProfileHealth } from "./doctor-auth.js";
describe("noteAuthProfileHealth", () => {
it("skips external auth profile resolution when no auth source exists", async () => {
await noteAuthProfileHealth({
cfg: { channels: { telegram: { enabled: true } } } as OpenClawConfig,
prompter: {} as DoctorPrompter,
allowKeychainPrompt: false,
});
expect(authProfileMocks.hasAnyAuthProfileStoreSource).toHaveBeenCalledOnce();
expect(authProfileMocks.ensureAuthProfileStore).not.toHaveBeenCalled();
});
});
¤ Dauer der Verarbeitung: 0.12 Sekunden
(vorverarbeitet am 2026-04-27)
¤
*© Formatika GbR, Deutschland