From ca17a9527072fa1a65111b6fe9f4e62e7fd9f382 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 31 Aug 2026 16:28:09 +0000 Subject: [PATCH] test: correct fixture and abort harness Co-authored-by: Simon Shi --- src/__tests__/models-cache.test.ts | 2 +- src/__tests__/stream.test.ts | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/__tests__/models-cache.test.ts b/src/__tests__/models-cache.test.ts index 2791866..6f7c2ab 100644 --- a/src/__tests__/models-cache.test.ts +++ b/src/__tests__/models-cache.test.ts @@ -32,7 +32,7 @@ afterEach(() => { describe("Qoder model cache", () => { it.each([ ["global", ["Lite", "GLM5.2"]], - ["cn", ["Auto", "Qwen3.7-Max"]], + ["cn", ["Qwen3.7Plus"]], ] as const)("maps the %s recorded-format catalog to friendly picker ids", async (region, expectedIds) => { const interaction = loadLiveFixture(region).interactions.modelList; vi.stubGlobal("fetch", vi.fn().mockResolvedValue(responseFromFixture(interaction))); diff --git a/src/__tests__/stream.test.ts b/src/__tests__/stream.test.ts index 7e880c8..273b025 100644 --- a/src/__tests__/stream.test.ts +++ b/src/__tests__/stream.test.ts @@ -432,6 +432,10 @@ describe("streamQoder", () => { globalThis.fetch = vi.fn( (_url: URL | RequestInfo, init?: RequestInit) => new Promise((_resolve, reject) => { + if (init?.signal?.aborted) { + reject(new DOMException("Aborted", "AbortError")); + return; + } init?.signal?.addEventListener("abort", () => reject(new DOMException("Aborted", "AbortError")), { once: true, });