From bfe264b55993bd05f49bd7a65119f716425a1ffd Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Wed, 14 Oct 2026 13:41:12 +0100 Subject: [PATCH] Add very basic `getApiClientWithExternalAuth` test --- src/api-client.test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/api-client.test.ts b/src/api-client.test.ts index 1a37425e4..2bb878f3b 100644 --- a/src/api-client.test.ts +++ b/src/api-client.test.ts @@ -292,6 +292,19 @@ test("makeProxyRequestOptions - returns fetch with custom proxy", async (t) => { ); }); +test.serial( + "getApiClientWithExternalAuth constructs clients with or without tokens", + (t) => { + t.notThrows(() => { + api.getApiClientWithExternalAuth(SAMPLE_DOTCOM_API_DETAILS); + api.getApiClientWithExternalAuth({ + ...SAMPLE_DOTCOM_API_DETAILS, + auth: undefined, + }); + }); + }, +); + test("getAuthorizationHeaderFor - returns undefined if there's no token", (t) => { const logger = new RecordingLogger();