test: type model list auth snapshot mock · openclaw/openclaw@fceaecd
shakkernerd
·
2026-04-30
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -2,12 +2,22 @@ import { describe, expect, it, vi } from "vitest";
|
2 | 2 | import type { AuthProfileStore } from "../../agents/auth-profiles/types.js"; |
3 | 3 | import { createModelListAuthIndex } from "./list.auth-index.js"; |
4 | 4 | |
| 5 | +type PluginSnapshotResult = { |
| 6 | +source: "persisted" | "provided" | "derived"; |
| 7 | +snapshot: { |
| 8 | +plugins: Array<{ enabled?: boolean; syntheticAuthRefs?: string[] }>; |
| 9 | +}; |
| 10 | +diagnostics: []; |
| 11 | +}; |
| 12 | + |
5 | 13 | const pluginRegistryMocks = vi.hoisted(() => ({ |
6 | | -loadPluginRegistrySnapshotWithMetadata: vi.fn(() => ({ |
7 | | -source: "persisted", |
8 | | -snapshot: { plugins: [] }, |
9 | | -diagnostics: [], |
10 | | -})), |
| 14 | +loadPluginRegistrySnapshotWithMetadata: vi.fn( |
| 15 | +(): PluginSnapshotResult => ({ |
| 16 | +source: "persisted", |
| 17 | +snapshot: { plugins: [] }, |
| 18 | +diagnostics: [], |
| 19 | +}), |
| 20 | +), |
11 | 21 | })); |
12 | 22 | |
13 | 23 | vi.mock("../../plugins/plugin-registry.js", async (importOriginal) => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。