diff --git a/lib/workers/repository/process/lookup/index.spec.ts b/lib/workers/repository/process/lookup/index.spec.ts index 1138ab3a3f175e..3d1be00a412ba8 100644 --- a/lib/workers/repository/process/lookup/index.spec.ts +++ b/lib/workers/repository/process/lookup/index.spec.ts @@ -9,16 +9,18 @@ import vueJson from '../../../../config/npm/__fixtures__/vue.json'; import webpackJson from '../../../../config/npm/__fixtures__/webpack.json'; import { CONFIG_VALIDATION } from '../../../../constants/error-messages'; import * as datasourceDocker from '../../../../datasource/docker'; +import { id as datasourceDockerId } from '../../../../datasource/docker'; import * as datasourceGitSubmodules from '../../../../datasource/git-submodules'; -import * as datasourceGithubTags from '../../../../datasource/github-tags'; -import * as datasourceNpm from '../../../../datasource/npm'; -import * as datasourcePackagist from '../../../../datasource/packagist'; -import * as datasourcePypi from '../../../../datasource/pypi'; -import * as dockerVersioning from '../../../../versioning/docker'; -import * as gitVersioning from '../../../../versioning/git'; -import * as npmVersioning from '../../../../versioning/npm'; -import * as pep440Versioning from '../../../../versioning/pep440'; -import * as poetryVersioning from '../../../../versioning/poetry'; +import { id as datasourceGitSubmodulesId } from '../../../../datasource/git-submodules'; +import { id as datasourceGithubTagsId } from '../../../../datasource/github-tags'; +import { id as datasourceNpmId } from '../../../../datasource/npm'; +import { id as datasourcePackagistId } from '../../../../datasource/packagist'; +import { id as datasourcePypiId } from '../../../../datasource/pypi'; +import { id as dockerVersioningId } from '../../../../versioning/docker'; +import { id as gitVersioningId } from '../../../../versioning/git'; +import { id as npmVersioningId } from '../../../../versioning/npm'; +import { id as pep440VersioningId } from '../../../../versioning/pep440'; +import { id as poetryVersioningId } from '../../../../versioning/poetry'; import * as lookup from '.'; jest.mock('../../../../datasource/docker'); @@ -36,7 +38,7 @@ describe('workers/repository/process/lookup', () => { // TODO: fix types config = partial(getConfig()); config.manager = 'npm'; - config.versioning = npmVersioning.id; + config.versioning = npmVersioningId; config.rangeStrategy = 'replace'; jest.resetAllMocks(); }); @@ -45,7 +47,7 @@ describe('workers/repository/process/lookup', () => { it('returns rollback for pinned version', async () => { config.currentValue = '0.9.99'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.rollbackPrs = true; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); @@ -53,7 +55,7 @@ describe('workers/repository/process/lookup', () => { it('returns rollback for ranged version', async () => { config.currentValue = '^0.9.99'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.rollbackPrs = true; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); @@ -62,7 +64,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^0.4.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -70,7 +72,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^0.4.0'; config.rangeStrategy = 'update-lockfile'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.lockedVersion = '0.4.0'; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); @@ -80,7 +82,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.4.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -92,7 +94,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'pin'; config.depName = 'q'; config.separateMinorPatch = true; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -104,7 +106,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'pin'; config.separateMajorMinor = false; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -115,7 +117,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.4.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -126,7 +128,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^0.4.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -135,7 +137,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^0.4.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -143,7 +145,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.4.0'; config.allowedVersions = '<1'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(1); }); @@ -151,7 +153,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.4.0'; config.allowedVersions = '/^0/'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(1); }); @@ -159,7 +161,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.4.0'; config.allowedVersions = '!/^1/'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(1); }); @@ -167,8 +169,8 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.4.0'; config.allowedVersions = '<1'; config.depName = 'q'; - config.versioning = dockerVersioning.id; // this doesn't make sense but works for this test - config.datasource = datasourceNpm.id; // this doesn't make sense but works for this test + config.versioning = dockerVersioningId; // this doesn't make sense but works for this test + config.datasource = datasourceNpmId; // this doesn't make sense but works for this test nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(1); }); @@ -176,8 +178,8 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.4.0'; config.allowedVersions = '==0.9.4'; config.depName = 'q'; - config.versioning = poetryVersioning.id; // this doesn't make sense but works for this test - config.datasource = datasourceNpm.id; // this doesn't make sense but works for this test + config.versioning = poetryVersioningId; // this doesn't make sense but works for this test + config.datasource = datasourceNpmId; // this doesn't make sense but works for this test nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(1); }); @@ -185,7 +187,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.4.0'; config.allowedVersions = 'less than 1'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); await expect(lookup.lookupUpdates(config)).rejects.toThrow( Error(CONFIG_VALIDATION) @@ -195,7 +197,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.9.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -210,7 +212,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.9.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -226,7 +228,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.9.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -237,7 +239,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.9.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -246,7 +248,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '0.8.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toHaveLength(3); @@ -257,7 +259,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^0.4.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -266,7 +268,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '1.0.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -274,7 +276,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '1.0.0'; config.vulnerabilityAlert = true; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = (await lookup.lookupUpdates(config)).updates; expect(res).toMatchSnapshot(); @@ -284,7 +286,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '~0.4.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -292,7 +294,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '~0.9.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -300,7 +302,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '~1.0.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -308,7 +310,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '~1.3.0'; config.rangeStrategy = 'widen'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -316,7 +318,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '~1.2.0 || ~1.3.0'; config.rangeStrategy = 'replace'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -324,7 +326,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^2.0.0'; config.rangeStrategy = 'widen'; config.depName = 'webpack'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); @@ -334,7 +336,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^1.0.0 || ^2.0.0'; config.rangeStrategy = 'replace'; config.depName = 'webpack'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); @@ -344,7 +346,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^1.0.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -353,7 +355,7 @@ describe('workers/repository/process/lookup', () => { config.lockedVersion = '1.0.0'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -361,7 +363,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '^1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(0); }); @@ -369,7 +371,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'pin'; config.currentValue = '~1.3.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -377,7 +379,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '1.3.x'; config.rangeStrategy = 'pin'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -385,7 +387,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '~1.3.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -393,7 +395,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '0.x'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -401,7 +403,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '1.3.x'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -409,7 +411,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '1.2.x - 1.3.x'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -417,7 +419,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -425,7 +427,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '1.3'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -433,7 +435,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '~0.7.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -441,7 +443,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '^0.7.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -449,7 +451,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '^0.7.0 || ^0.8.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toHaveLength(2); @@ -459,7 +461,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '^1.0.0 || ^2.0.0'; config.depName = 'webpack'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); @@ -469,7 +471,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '1.x - 2.x'; config.depName = 'webpack'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); @@ -479,7 +481,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '1.x || 2.x'; config.depName = 'webpack'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); @@ -489,7 +491,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '1 || 2'; config.depName = 'webpack'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); @@ -499,7 +501,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '~1.2.0 || ~1.3.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -507,7 +509,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '>= 0.7.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(0); }); @@ -515,7 +517,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '<= 0.7.2'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -523,7 +525,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '< 0.7.2'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -531,7 +533,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '< 1'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -539,7 +541,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '<= 1.3'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -547,7 +549,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '=1.3.1'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -556,7 +558,7 @@ describe('workers/repository/process/lookup', () => { config.respectLatest = false; config.currentValue = '<= 1'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -564,7 +566,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '<= 1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -574,7 +576,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '< 1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -584,7 +586,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '>= 0.5.0 < 1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -594,7 +596,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '>= 0.5.0 <0.8'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -605,7 +607,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '>= 0.5.0 <= 0.8.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -616,7 +618,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'widen'; config.currentValue = '<= 0.8.0 >= 0.5.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -625,14 +627,14 @@ describe('workers/repository/process/lookup', () => { config.respectLatest = false; config.currentValue = '1.4.1'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); it('should ignore unstable versions if the current version is stable', async () => { config.currentValue = '2.5.16'; config.depName = 'vue'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/vue').reply(200, vueJson); expect((await lookup.lookupUpdates(config)).updates).toHaveLength(0); }); @@ -640,7 +642,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '2.5.16'; config.ignoreUnstable = false; config.depName = 'vue'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/vue').reply(200, vueJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -650,7 +652,7 @@ describe('workers/repository/process/lookup', () => { it('should allow unstable versions if the current version is unstable', async () => { config.currentValue = '3.1.0-dev.20180731'; config.depName = 'typescript'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/typescript') .reply(200, typescriptJson); @@ -662,7 +664,7 @@ describe('workers/repository/process/lookup', () => { it('should not jump unstable versions', async () => { config.currentValue = '3.0.1-insiders.20180726'; config.depName = 'typescript'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/typescript') .reply(200, typescriptJson); @@ -674,7 +676,7 @@ describe('workers/repository/process/lookup', () => { it('should follow dist-tag even if newer version exists', async () => { config.currentValue = '3.0.1-insiders.20180713'; config.depName = 'typescript'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.followTag = 'insiders'; nock('https://registry.npmjs.org') .get('/typescript') @@ -687,7 +689,7 @@ describe('workers/repository/process/lookup', () => { it('should roll back to dist-tag if current version is higher', async () => { config.currentValue = '3.1.0-dev.20180813'; config.depName = 'typescript'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.followTag = 'insiders'; config.rollbackPrs = true; nock('https://registry.npmjs.org') @@ -701,7 +703,7 @@ describe('workers/repository/process/lookup', () => { it('should jump unstable versions if followTag', async () => { config.currentValue = '3.0.0-insiders.20180706'; config.depName = 'typescript'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.followTag = 'insiders'; nock('https://registry.npmjs.org') .get('/typescript') @@ -714,7 +716,7 @@ describe('workers/repository/process/lookup', () => { it('should update nothing if current version is dist-tag', async () => { config.currentValue = '3.0.1-insiders.20180726'; config.depName = 'typescript'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.followTag = 'insiders'; nock('https://registry.npmjs.org') .get('/typescript') @@ -725,7 +727,7 @@ describe('workers/repository/process/lookup', () => { it('should warn if no version matches dist-tag', async () => { config.currentValue = '3.0.1-dev.20180726'; config.depName = 'typescript'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.followTag = 'foo'; nock('https://registry.npmjs.org') .get('/typescript') @@ -742,7 +744,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '~0.0.34'; config.depName = '@types/helmet'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/@types%2Fhelmet') .reply(200, helmetJson); @@ -752,7 +754,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'replace'; config.currentValue = '^0.0.34'; config.depName = '@types/helmet'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/@types%2Fhelmet') .reply(200, helmetJson); @@ -761,7 +763,7 @@ describe('workers/repository/process/lookup', () => { it('should downgrade from missing versions', async () => { config.currentValue = '1.16.1'; config.depName = 'coffeelint'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.rollbackPrs = true; nock('https://registry.npmjs.org') .get('/coffeelint') @@ -773,7 +775,7 @@ describe('workers/repository/process/lookup', () => { it('should upgrade to only one major', async () => { config.currentValue = '1.0.0'; config.depName = 'webpack'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); @@ -784,7 +786,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '1.0.0'; config.separateMultipleMajor = true; config.depName = 'webpack'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org') .get('/webpack') .reply(200, webpackJson); @@ -795,7 +797,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '^4.4.0-canary.3'; config.rangeStrategy = 'replace'; config.depName = 'next'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/next').reply(200, nextJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toHaveLength(0); @@ -804,7 +806,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'bump'; config.currentValue = '^1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -812,7 +814,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'bump'; config.currentValue = '~1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -821,7 +823,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '~1.0.0'; config.depName = 'q'; config.separateMinorPatch = true; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -829,7 +831,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'bump'; config.currentValue = '>=1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -837,7 +839,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'bump'; config.currentValue = '>=0.9.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -845,7 +847,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'bump'; config.currentValue = '>1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -853,7 +855,7 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'bump'; config.currentValue = '1.x'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); @@ -861,13 +863,13 @@ describe('workers/repository/process/lookup', () => { config.rangeStrategy = 'bump'; config.currentValue = '^0.9.0 || ^1.0.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); expect((await lookup.lookupUpdates(config)).updates).toMatchSnapshot(); }); it('replaces non-range in-range updates', async () => { config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; config.packageFile = 'package.json'; config.rangeStrategy = 'bump'; config.currentValue = '1.0.0'; @@ -876,7 +878,7 @@ describe('workers/repository/process/lookup', () => { }); it('handles github 404', async () => { config.depName = 'foo'; - config.datasource = datasourceGithubTags.id; + config.datasource = datasourceGithubTagsId; config.packageFile = 'package.json'; config.currentValue = '1.0.0'; nock('https://pypi.org').get('/pypi/foo/json').reply(404); @@ -884,7 +886,7 @@ describe('workers/repository/process/lookup', () => { }); it('handles pypi 404', async () => { config.depName = 'foo'; - config.datasource = datasourcePypi.id; + config.datasource = datasourcePypiId; config.packageFile = 'requirements.txt'; config.currentValue = '1.0.0'; nock('https://api.github.com') @@ -894,7 +896,7 @@ describe('workers/repository/process/lookup', () => { }); it('handles packagist', async () => { config.depName = 'foo/bar'; - config.datasource = datasourcePackagist.id; + config.datasource = datasourcePackagistId; config.packageFile = 'composer.json'; config.currentValue = '1.0.0'; config.registryUrls = ['https://packagist.org']; @@ -910,7 +912,7 @@ describe('workers/repository/process/lookup', () => { }); it('handles PEP440', async () => { config.manager = 'pip_requirements'; - config.versioning = pep440Versioning.id; + config.versioning = pep440VersioningId; config.manager = 'pip_requirements'; config.versioning = 'pep440'; config.rangeStrategy = 'pin'; @@ -918,7 +920,7 @@ describe('workers/repository/process/lookup', () => { config.currentValue = '~=0.9'; config.depName = 'q'; // TODO: we are using npm as source to test pep440 - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res.updates).toMatchSnapshot(); @@ -926,7 +928,7 @@ describe('workers/repository/process/lookup', () => { it('returns complex object', async () => { config.currentValue = '1.3.0'; config.depName = 'q'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; nock('https://registry.npmjs.org').get('/q').reply(200, qJson); const res = await lookup.lookupUpdates(config); expect(res).toMatchSnapshot(); @@ -935,7 +937,7 @@ describe('workers/repository/process/lookup', () => { it('ignores deprecated', async () => { config.currentValue = '1.3.0'; config.depName = 'q2'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; const returnJson = JSON.parse(JSON.stringify(qJson)); returnJson.name = 'q2'; returnJson.versions['1.4.1'].deprecated = 'true'; @@ -947,7 +949,7 @@ describe('workers/repository/process/lookup', () => { it('is deprecated', async () => { config.currentValue = '1.3.0'; config.depName = 'q3'; - config.datasource = datasourceNpm.id; + config.datasource = datasourceNpmId; const returnJson = { ...JSON.parse(JSON.stringify(qJson)), name: 'q3', @@ -963,20 +965,20 @@ describe('workers/repository/process/lookup', () => { it('skips unsupported values', async () => { config.currentValue = 'alpine'; config.depName = 'node'; - config.datasource = datasourceDocker.id; + config.datasource = datasourceDockerId; const res = await lookup.lookupUpdates(config); expect(res).toMatchSnapshot(); }); it('skips undefined values', async () => { config.depName = 'node'; - config.datasource = datasourceDocker.id; + config.datasource = datasourceDockerId; const res = await lookup.lookupUpdates(config); expect(res).toMatchSnapshot(); }); it('handles digest pin', async () => { config.currentValue = '8.0.0'; config.depName = 'node'; - config.datasource = datasourceDocker.id; + config.datasource = datasourceDockerId; config.pinDigests = true; docker.getReleases.mockResolvedValueOnce({ releases: [ @@ -997,8 +999,8 @@ describe('workers/repository/process/lookup', () => { it('skips uncompatible versions for ' + currentValue, async () => { config.currentValue = currentValue; config.depName = 'node'; - config.versioning = dockerVersioning.id; - config.datasource = datasourceDocker.id; + config.versioning = dockerVersioningId; + config.datasource = datasourceDockerId; docker.getReleases.mockResolvedValueOnce({ releases: [ { version: '8.1.0' }, @@ -1019,7 +1021,7 @@ describe('workers/repository/process/lookup', () => { it('handles digest pin for up to date version', async () => { config.currentValue = '8.1.0'; config.depName = 'node'; - config.datasource = datasourceDocker.id; + config.datasource = datasourceDockerId; config.pinDigests = true; docker.getReleases.mockResolvedValueOnce({ releases: [ @@ -1038,7 +1040,7 @@ describe('workers/repository/process/lookup', () => { it('handles digest pin for non-version', async () => { config.currentValue = 'alpine'; config.depName = 'node'; - config.datasource = datasourceDocker.id; + config.datasource = datasourceDockerId; config.pinDigests = true; docker.getReleases.mockResolvedValueOnce({ releases: [ @@ -1060,7 +1062,7 @@ describe('workers/repository/process/lookup', () => { it('handles digest lookup failure', async () => { config.currentValue = 'alpine'; config.depName = 'node'; - config.datasource = datasourceDocker.id; + config.datasource = datasourceDockerId; config.pinDigests = true; docker.getReleases.mockResolvedValueOnce({ releases: [ @@ -1082,7 +1084,7 @@ describe('workers/repository/process/lookup', () => { it('handles digest update', async () => { config.currentValue = '8.0.0'; config.depName = 'node'; - config.datasource = datasourceDocker.id; + config.datasource = datasourceDockerId; config.currentDigest = 'sha256:zzzzzzzzzzzzzzz'; config.pinDigests = true; docker.getReleases.mockResolvedValueOnce({ @@ -1103,7 +1105,7 @@ describe('workers/repository/process/lookup', () => { it('handles digest update for non-version', async () => { config.currentValue = 'alpine'; config.depName = 'node'; - config.datasource = datasourceDocker.id; + config.datasource = datasourceDockerId; config.currentDigest = 'sha256:zzzzzzzzzzzzzzz'; config.pinDigests = true; docker.getReleases.mockResolvedValueOnce({ @@ -1125,8 +1127,8 @@ describe('workers/repository/process/lookup', () => { }); it('handles git submodule update', async () => { config.depName = 'some-path'; - config.versioning = gitVersioning.id; - config.datasource = datasourceGitSubmodules.id; + config.versioning = gitVersioningId; + config.datasource = datasourceGitSubmodulesId; gitSubmodules.getReleases.mockResolvedValueOnce({ releases: [ {