From 767ce36ac361ec2538e91429f994c7a0ba1b9462 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Sun, 24 Nov 2024 12:01:18 -0800 Subject: [PATCH] fix: ensure to wrap fetch in setFetch --- src/common/fetch.ts | 2 +- test/test.html | 123 +++++++++++++++++++------------------------- 2 files changed, 55 insertions(+), 70 deletions(-) diff --git a/src/common/fetch.ts b/src/common/fetch.ts index f57f045..fce155e 100644 --- a/src/common/fetch.ts +++ b/src/common/fetch.ts @@ -45,7 +45,7 @@ let _fetch: WrappedFetch = wrappedFetch(fetchImpl); * Allows customizing the fetch implementation used by the generator. */ export function setFetch(fetch: typeof globalThis.fetch | WrappedFetch) { - _fetch = fetch as WrappedFetch; + _fetch = wrappedFetch(fetch as WrappedFetch); } export { clearCache, _fetch as fetch }; diff --git a/test/test.html b/test/test.html index 7d1d1b3..8e1afb1 100644 --- a/test/test.html +++ b/test/test.html @@ -1,100 +1,85 @@ - +