defer fetch lookup so test interceptors apply

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) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
This commit is contained in:
Fredrik Adelöw
2026-05-04 14:01:43 +02:00
parent 1500fe31b4
commit dd78c9cffa
@@ -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) {