



























@@ -179,14 +179,18 @@ describe("custom theme import helpers", () => {
179179);
180180181181expect(imported.label).toBe("Light Green");
182-expect(fetchImpl).toHaveBeenCalledWith(
183-"https://tweakcn.com/r/themes/cmlhfpjhw000004l4f4ax3m7z",
184-expect.objectContaining({
185-headers: { accept: "application/json" },
186-redirect: "error",
187-signal: expect.any(AbortSignal),
188-}),
189-);
182+const fetchMock = vi.mocked(fetchImpl);
183+expect(fetchMock).toHaveBeenCalledTimes(1);
184+const [fetchUrl, fetchOptions] = fetchMock.mock.calls[0] as [
185+string,
186+{ headers?: unknown; redirect?: unknown; signal?: unknown },
187+];
188+expect(fetchUrl).toBe("https://tweakcn.com/r/themes/cmlhfpjhw000004l4f4ax3m7z");
189+expect(fetchOptions).toMatchObject({
190+headers: { accept: "application/json" },
191+redirect: "error",
192+});
193+expect(fetchOptions.signal).toBeInstanceOf(AbortSignal);
190194});
191195192196it("rejects oversized tweakcn theme responses before parsing", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。