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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user