





















@@ -166,12 +166,12 @@ describe("lmstudio-models", () => {
166166).toEqual({
167167supportsReasoningEffort: true,
168168supportedReasoningEfforts: ["none", "minimal", "low", "medium", "high", "xhigh"],
169-reasoningEffortMap: expect.objectContaining({
169+reasoningEffortMap: {
170170off: "none",
171171none: "none",
172172adaptive: "xhigh",
173173max: "xhigh",
174-}),
174+},
175175});
176176177177expect(
@@ -186,10 +186,10 @@ describe("lmstudio-models", () => {
186186).toEqual({
187187supportsReasoningEffort: true,
188188supportedReasoningEfforts: ["low", "medium", "high"],
189-reasoningEffortMap: expect.objectContaining({
189+reasoningEffortMap: {
190190adaptive: "high",
191191max: "high",
192-}),
192+},
193193});
194194195195expect(
@@ -248,14 +248,16 @@ describe("lmstudio-models", () => {
248248fetchImpl: asFetch(fetchMock),
249249});
250250251-expect(fetchMock).toHaveBeenCalledWith(
252-"http://localhost:1234/api/v1/models",
253-expect.objectContaining({
254-headers: {
255-Authorization: "Bearer lm-token",
256-},
257-}),
251+const modelsRequest = fetchMock.mock.calls.find(
252+([url]) => url === "http://localhost:1234/api/v1/models",
258253);
254+const modelsRequestOptions = modelsRequest?.[1] as
255+| { headers?: Record<string, string>; signal?: unknown }
256+| undefined;
257+expect(modelsRequestOptions?.headers).toEqual({
258+Authorization: "Bearer lm-token",
259+});
260+expect(modelsRequestOptions?.signal).toBeInstanceOf(AbortSignal);
259261260262expect(models).toHaveLength(2);
261263expect(models[0]).toEqual({
@@ -268,12 +270,12 @@ describe("lmstudio-models", () => {
268270supportsUsageInStreaming: true,
269271supportsReasoningEffort: true,
270272supportedReasoningEfforts: ["none", "minimal", "low", "medium", "high", "xhigh"],
271-reasoningEffortMap: expect.objectContaining({
273+reasoningEffortMap: {
272274off: "none",
273275none: "none",
274276adaptive: "xhigh",
275277max: "xhigh",
276-}),
278+},
277279},
278280contextWindow: 262144,
279281contextTokens: LMSTUDIO_DEFAULT_LOAD_CONTEXT_LENGTH,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。