diff --git a/extensions/lmstudio/src/models.test.ts b/extensions/lmstudio/src/models.test.ts index 2882c4da11e..32da65123eb 100644 --- a/extensions/lmstudio/src/models.test.ts +++ b/extensions/lmstudio/src/models.test.ts @@ -166,12 +166,12 @@ describe("lmstudio-models", () => { ).toEqual({ supportsReasoningEffort: true, supportedReasoningEfforts: ["none", "minimal", "low", "medium", "high", "xhigh"], - reasoningEffortMap: expect.objectContaining({ + reasoningEffortMap: { off: "none", none: "none", adaptive: "xhigh", max: "xhigh", - }), + }, }); expect( @@ -186,10 +186,10 @@ describe("lmstudio-models", () => { ).toEqual({ supportsReasoningEffort: true, supportedReasoningEfforts: ["low", "medium", "high"], - reasoningEffortMap: expect.objectContaining({ + reasoningEffortMap: { adaptive: "high", max: "high", - }), + }, }); expect( @@ -248,14 +248,16 @@ describe("lmstudio-models", () => { fetchImpl: asFetch(fetchMock), }); - expect(fetchMock).toHaveBeenCalledWith( - "http://localhost:1234/api/v1/models", - expect.objectContaining({ - headers: { - Authorization: "Bearer lm-token", - }, - }), + const modelsRequest = fetchMock.mock.calls.find( + ([url]) => url === "http://localhost:1234/api/v1/models", ); + const modelsRequestOptions = modelsRequest?.[1] as + | { headers?: Record; signal?: unknown } + | undefined; + expect(modelsRequestOptions?.headers).toEqual({ + Authorization: "Bearer lm-token", + }); + expect(modelsRequestOptions?.signal).toBeInstanceOf(AbortSignal); expect(models).toHaveLength(2); expect(models[0]).toEqual({ @@ -268,12 +270,12 @@ describe("lmstudio-models", () => { supportsUsageInStreaming: true, supportsReasoningEffort: true, supportedReasoningEfforts: ["none", "minimal", "low", "medium", "high", "xhigh"], - reasoningEffortMap: expect.objectContaining({ + reasoningEffortMap: { off: "none", none: "none", adaptive: "xhigh", max: "xhigh", - }), + }, }, contextWindow: 262144, contextTokens: LMSTUDIO_DEFAULT_LOAD_CONTEXT_LENGTH,