From fceaecd12319572f607285f9467517dbdc745803 Mon Sep 17 00:00:00 2001 From: Shakker Date: Wed, 29 Apr 2026 17:55:42 +0100 Subject: [PATCH] test: type model list auth snapshot mock --- src/commands/models/list.auth-index.test.ts | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/commands/models/list.auth-index.test.ts b/src/commands/models/list.auth-index.test.ts index 74443b312bf..b070a2b5cd8 100644 --- a/src/commands/models/list.auth-index.test.ts +++ b/src/commands/models/list.auth-index.test.ts @@ -2,12 +2,22 @@ import { describe, expect, it, vi } from "vitest"; import type { AuthProfileStore } from "../../agents/auth-profiles/types.js"; import { createModelListAuthIndex } from "./list.auth-index.js"; +type PluginSnapshotResult = { + source: "persisted" | "provided" | "derived"; + snapshot: { + plugins: Array<{ enabled?: boolean; syntheticAuthRefs?: string[] }>; + }; + diagnostics: []; +}; + const pluginRegistryMocks = vi.hoisted(() => ({ - loadPluginRegistrySnapshotWithMetadata: vi.fn(() => ({ - source: "persisted", - snapshot: { plugins: [] }, - diagnostics: [], - })), + loadPluginRegistrySnapshotWithMetadata: vi.fn( + (): PluginSnapshotResult => ({ + source: "persisted", + snapshot: { plugins: [] }, + diagnostics: [], + }), + ), })); vi.mock("../../plugins/plugin-registry.js", async (importOriginal) => {