diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index eb9c5d866ffa2e74d605557938eeee32b34dc069..fbee93dd5f69f85e3e33bc660de5b82e5a81a88f 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -51,6 +51,11 @@ describe('workers/repository/process/lookup', () => { }); describe('.lookupUpdates()', () => { + it('returns null if unknown datasource', async () => { + config.depName = 'some-dep'; + config.datasource = 'does not exist'; + expect((await lookup.lookupUpdates(config)).updates).toEqual([]); + }); it('returns rollback for pinned version', async () => { config.currentValue = '0.9.99'; config.depName = 'q'; diff --git a/lib/workers/repository/process/lookup/index.ts b/lib/workers/repository/process/lookup/index.ts index 0c5e6c69f6bdccd15dc04da4a2524d615526e3b9..8d4374e2a0c732aa8d95288c23641a0469fbc4df 100644 --- a/lib/workers/repository/process/lookup/index.ts +++ b/lib/workers/repository/process/lookup/index.ts @@ -1,6 +1,7 @@ import type { ValidationMessage } from '../../../../config/types'; import { Release, + getDatasourceList, getDefaultVersioning, getDigest, getPkgReleases, @@ -45,7 +46,10 @@ export async function lookupUpdates( ); const res: UpdateResult = { updates: [], warnings: [] } as any; // istanbul ignore if - if (!isGetPkgReleasesConfig(config)) { + if ( + !isGetPkgReleasesConfig(config) || + !getDatasourceList().includes(datasource) + ) { res.skipReason = SkipReason.InvalidConfig; return res; }