
























@@ -36,8 +36,9 @@ describe("resolveVisibleModelCatalog", () => {
3636expect(checkerOptions?.cfg).toBe(cfg);
3737expect(checkerOptions?.allowPluginSyntheticAuth).toBe(false);
3838expect(checkerOptions?.discoverExternalCliAuth).toBe(false);
39-expect(authChecker).toHaveBeenCalledWith("anthropic");
40-expect(authChecker).toHaveBeenCalledWith("openai");
39+expect(authChecker).toHaveBeenNthCalledWith(1, "anthropic");
40+expect(authChecker).toHaveBeenNthCalledWith(2, "openai");
41+expect(authChecker).toHaveBeenCalledTimes(2);
4142expect(result).toEqual([{ provider: "openai", id: "gpt-test", name: "GPT Test" }]);
4243});
4344@@ -68,7 +69,16 @@ describe("resolveVisibleModelCatalog", () => {
6869runtimeAuthDiscovery: true,
6970});
707171-expect(createProviderAuthCheckerMock).toHaveBeenCalled();
72+expect(createProviderAuthCheckerMock).toHaveBeenCalledTimes(1);
73+expect(createProviderAuthCheckerMock.mock.calls[0]?.[0]).toMatchObject({
74+allowPluginSyntheticAuth: true,
75+discoverExternalCliAuth: true,
76+});
77+expect(authChecker).toHaveBeenNthCalledWith(1, "anthropic");
78+expect(authChecker).toHaveBeenNthCalledWith(2, "openai-codex");
79+expect(authChecker).toHaveBeenNthCalledWith(3, "vllm");
80+expect(authChecker).toHaveBeenNthCalledWith(4, "blocked");
81+expect(authChecker).toHaveBeenCalledTimes(4);
7282expect(result).toEqual([
7383{ provider: "openai-codex", id: "gpt-codex-test", name: "GPT Codex Test" },
7484{ provider: "vllm", id: "qwen-local", name: "Qwen Local" },
@@ -94,7 +104,13 @@ describe("resolveVisibleModelCatalog", () => {
94104runtimeAuthDiscovery: true,
95105});
9610697-expect(createProviderAuthCheckerMock).toHaveBeenCalled();
107+expect(createProviderAuthCheckerMock).toHaveBeenCalledTimes(1);
108+expect(createProviderAuthCheckerMock.mock.calls[0]?.[0]).toMatchObject({
109+allowPluginSyntheticAuth: true,
110+discoverExternalCliAuth: true,
111+});
112+expect(authChecker).toHaveBeenCalledWith("anthropic");
113+expect(authChecker).toHaveBeenCalledTimes(1);
98114expect(result).toEqual([]);
99115});
100116});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。