From dd78c9cffa4a1b2327ff4bc0a151a0de37e035c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Mon, 4 May 2026 14:01:43 +0200 Subject: [PATCH] defer fetch lookup so test interceptors apply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Capturing globalThis.fetch as a value at construction time meant the GitLabUrlReader tests bypassed the MSW fetch interceptor and hit the real gitlab.com (returning 401). Wrapping the call resolves fetch at invocation time so the patched fetch is used. Co-Authored-By: Claude Opus 4.7 (1M context) Signed-off-by: Fredrik Adelöw --- packages/integration/src/gitlab/GitLabIntegration.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/integration/src/gitlab/GitLabIntegration.ts b/packages/integration/src/gitlab/GitLabIntegration.ts index f917ac92d9..4f6985e344 100644 --- a/packages/integration/src/gitlab/GitLabIntegration.ts +++ b/packages/integration/src/gitlab/GitLabIntegration.ts @@ -75,7 +75,7 @@ export class GitLabIntegration implements ScmIntegration { } private createFetchStrategy(): FetchFunction { - let fetchFn: FetchFunction = fetch; + let fetchFn: FetchFunction = (url, options) => fetch(url, options); const retryConfig = this.integrationConfig.retry; if (retryConfig) {