From 7b17f10da7b653279afdc34f0fb5d3dd26af4d08 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Mon, 14 Aug 2023 16:03:04 +0200 Subject: [PATCH] Fix http client fallback tests --- packages/api/test/unit/client/httpClientFallback.test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/api/test/unit/client/httpClientFallback.test.ts b/packages/api/test/unit/client/httpClientFallback.test.ts index bf929cf854a2..2c0846d00148 100644 --- a/packages/api/test/unit/client/httpClientFallback.test.ts +++ b/packages/api/test/unit/client/httpClientFallback.test.ts @@ -8,7 +8,7 @@ describe("httpClient fallback", () => { // Using fetchSub instead of actually setting up servers because there are some strange // race conditions, where the server stub doesn't count the call in time before the test is over. - const fetchStub = Sinon.stub<[string], ReturnType>(); + const fetchStub = Sinon.stub<[URL], ReturnType>(); let httpClient: HttpClient; @@ -21,10 +21,10 @@ describe("httpClient fallback", () => { const serverErrors = new Map(); // With baseURLs above find the server index associated with that URL - function getServerIndex(url: string): number { - const i = baseUrls.findIndex((baseUrl) => url.startsWith(baseUrl)); + function getServerIndex(url: URL): number { + const i = baseUrls.findIndex((baseUrl) => url.toString().startsWith(baseUrl)); if (i < 0) { - throw Error(`fetch called with unknown url ${url}`); + throw Error(`fetch called with unknown url ${url.toString()}`); } return i; }