diff --git a/lib/modules/datasource/nuget/__snapshots__/index.spec.ts.snap b/lib/modules/datasource/nuget/__snapshots__/index.spec.ts.snap index bdce30f14a..e668b57267 100644 --- a/lib/modules/datasource/nuget/__snapshots__/index.spec.ts.snap +++ b/lib/modules/datasource/nuget/__snapshots__/index.spec.ts.snap @@ -1497,6 +1497,7 @@ exports[`modules/datasource/nuget/index getReleases processes real data (v3) nus "version": "3.12.0", }, ], + "sourceUrl": "https://nunit.org/", } `; @@ -1686,6 +1687,7 @@ exports[`modules/datasource/nuget/index getReleases processes real data (v3) nus "version": "3.12.0", }, ], + "sourceUrl": "https://nunit.org/", } `; diff --git a/lib/modules/datasource/nuget/index.spec.ts b/lib/modules/datasource/nuget/index.spec.ts index ce25cf7722..571727091d 100644 --- a/lib/modules/datasource/nuget/index.spec.ts +++ b/lib/modules/datasource/nuget/index.spec.ts @@ -714,7 +714,7 @@ describe('modules/datasource/nuget/index', () => { }); expect(res).not.toBeNull(); expect(res).toMatchSnapshot(); - expect(res?.sourceUrl).toBeUndefined(); + expect(res?.sourceUrl).toBeDefined(); }); it('processes real data (v3) nuspec fetch 404 error', async () => { @@ -732,7 +732,7 @@ describe('modules/datasource/nuget/index', () => { }); expect(res).not.toBeNull(); expect(res).toMatchSnapshot(); - expect(res?.sourceUrl).toBeUndefined(); + expect(res?.sourceUrl).toBeDefined(); }); it('processes real data (v2)', async () => { diff --git a/lib/modules/datasource/nuget/v3.ts b/lib/modules/datasource/nuget/v3.ts index 1d0dc587c0..a0e06db3de 100644 --- a/lib/modules/datasource/nuget/v3.ts +++ b/lib/modules/datasource/nuget/v3.ts @@ -240,13 +240,12 @@ export class NugetV3Api { { registryUrl, pkgName, pkgVersion: latestStable }, `package manifest (.nuspec) not found`, ); - return dep; + } else { + logger.debug( + { err, registryUrl, pkgName, pkgVersion: latestStable }, + `Cannot obtain sourceUrl`, + ); } - logger.debug( - { err, registryUrl, pkgName, pkgVersion: latestStable }, - `Cannot obtain sourceUrl`, - ); - return dep; } // istanbul ignore else: not easy testable