diff --git a/lib/datasource/nuget/index.spec.ts b/lib/datasource/nuget/index.spec.ts index 5fa8ac0e3b2f1b91637d5c630f76bd97138109a7..986835311df6da90797ebd22aa9c13c402f1064f 100644 --- a/lib/datasource/nuget/index.spec.ts +++ b/lib/datasource/nuget/index.spec.ts @@ -58,10 +58,6 @@ const nugetIndexV3 = fs.readFileSync( 'utf8' ); -const configNoRegistryUrls = { - lookupName: 'nunit', -}; - const configV3V2 = { lookupName: 'nunit', registryUrls: [ @@ -118,15 +114,6 @@ describe('datasource/nuget', () => { expect(got.mock.calls[0][0]).toEqual('https://my-registry/'); }); - it('queries the default nuget feed if no registries are supplied', async () => { - await nuget.getReleases({ - ...configNoRegistryUrls, - }); - expect(got.mock.calls[0][0]).toEqual( - 'https://api.nuget.org/v3/index.json' - ); - }); - it(`can't get packages list (v3)`, async () => { got.mockReturnValueOnce({ body: JSON.parse(nugetIndexV3), diff --git a/lib/datasource/nuget/index.ts b/lib/datasource/nuget/index.ts index 5d039566d5d08cf2fbb37f82d27f21bf814d4b67..fbffe0c72fb5fbe68ee9b6200c63abd8aa300379 100644 --- a/lib/datasource/nuget/index.ts +++ b/lib/datasource/nuget/index.ts @@ -6,7 +6,7 @@ import { GetReleasesConfig, ReleaseResult } from '../common'; export { id } from './common'; -export { getDefaultFeed } from './v3'; +export const defaultRegistryUrls = [v3.getDefaultFeed()]; function parseRegistryUrl( registryUrl: string @@ -35,7 +35,7 @@ export async function getReleases({ }: GetReleasesConfig): Promise<ReleaseResult> { logger.trace(`nuget.getReleases(${lookupName})`); let dep: ReleaseResult = null; - for (const feed of registryUrls || [v3.getDefaultFeed()]) { + for (const feed of registryUrls) { const { feedUrl, protocolVersion } = parseRegistryUrl(feed); if (protocolVersion === 2) { dep = await v2.getReleases(feedUrl, lookupName); diff --git a/lib/manager/nuget/extract.ts b/lib/manager/nuget/extract.ts index 5337f3fdd6ad8a9fdd528e74aef5bb0358902840..3149ddadec3ab1a1247282cbdc8aa002eaa26454 100644 --- a/lib/manager/nuget/extract.ts +++ b/lib/manager/nuget/extract.ts @@ -42,7 +42,7 @@ async function determineRegistryUrls( return undefined; } - const registryUrls = [datasourceNuget.getDefaultFeed()]; + const registryUrls = datasourceNuget.defaultRegistryUrls; for (const child of packageSources.children) { if (child.type === 'element') { if (child.name === 'clear') {