diff --git a/lib/modules/platform/default-scm.spec.ts b/lib/modules/platform/default-scm.spec.ts index 2ec02871c8d32d..023948fa3dacae 100644 --- a/lib/modules/platform/default-scm.spec.ts +++ b/lib/modules/platform/default-scm.spec.ts @@ -15,7 +15,7 @@ describe('modules/platform/default-scm', () => { it('delegate commitAndPush to util/git', async () => { git.commitFiles.mockResolvedValueOnce('sha'); - await defaultGitScm.commitAndPush(partial({})); + await defaultGitScm.commitAndPush(partial()); expect(git.commitFiles).toHaveBeenCalledTimes(1); }); diff --git a/lib/workers/repository/update/branch/execute-post-upgrade-commands.spec.ts b/lib/workers/repository/update/branch/execute-post-upgrade-commands.spec.ts index 583a2c4d62cc1e..242f1b37d2af83 100644 --- a/lib/workers/repository/update/branch/execute-post-upgrade-commands.spec.ts +++ b/lib/workers/repository/update/branch/execute-post-upgrade-commands.spec.ts @@ -10,7 +10,7 @@ jest.mock('../../../../util/git'); describe('workers/repository/update/branch/execute-post-upgrade-commands', () => { describe('postUpgradeCommandsExecutor', () => { it('handles an artifact which is a directory', async () => { - const commands: BranchUpgradeConfig[] = [ + const commands = partial([ { manager: 'some-manager', branchName: 'main', @@ -19,7 +19,7 @@ describe('workers/repository/update/branch/execute-post-upgrade-commands', () => commands: ['disallowed_command'], }, }, - ]; + ]); const config: BranchConfig = { manager: 'some-manager', updatedPackageFiles: [], diff --git a/lib/workers/repository/update/branch/index.spec.ts b/lib/workers/repository/update/branch/index.spec.ts index 915f2ff92c4f28..ff9b3fac8a1a98 100644 --- a/lib/workers/repository/update/branch/index.spec.ts +++ b/lib/workers/repository/update/branch/index.spec.ts @@ -108,7 +108,7 @@ describe('workers/repository/update/branch/index', () => { branchName: 'renovate/some-branch', errors: [], warnings: [], - upgrades: [partial({ depName: 'some-dep-name' })], + upgrades: partial([{ depName: 'some-dep-name' }]), } as BranchConfig; schedule.isScheduledNow.mockReturnValue(true); commit.commitFilesToBranch.mockResolvedValue('123test'); @@ -185,12 +185,12 @@ describe('workers/repository/update/branch/index', () => { it('skips branch if not stabilityDays not met', async () => { schedule.isScheduledNow.mockReturnValueOnce(true); config.prCreation = 'not-pending'; - (config.upgrades as Partial[]) = [ + config.upgrades = partial([ { releaseTimestamp: '2099-12-31', stabilityDays: 1, }, - ]; + ]); const res = await branchWorker.processBranch(config); expect(res).toEqual({ branchExists: false, @@ -221,11 +221,11 @@ describe('workers/repository/update/branch/index', () => { it('processes branch if minimumConfidence is met', async () => { schedule.isScheduledNow.mockReturnValueOnce(true); config.prCreation = 'not-pending'; - (config.upgrades as Partial[]) = [ + config.upgrades = partial([ { minimumConfidence: 'high', }, - ]; + ]); mergeConfidence.isActiveConfidenceLevel.mockReturnValue(true); mergeConfidence.satisfiesConfidenceLevel.mockReturnValueOnce(true); const res = await branchWorker.processBranch(config); @@ -1597,15 +1597,14 @@ describe('workers/repository/update/branch/index', () => { fileFilters: ['modified_file', 'deleted_file'], }, upgrades: [ - { - ...getConfig(), + partial({ depName: 'some-dep-name', postUpgradeTasks: { executionMode: 'update', commands: ['echo {{{versioning}}}', 'disallowed task'], fileFilters: ['modified_file', 'deleted_file'], }, - } as BranchUpgradeConfig, + }), ], } as BranchConfig; const result = await branchWorker.processBranch(inconfig); @@ -1705,9 +1704,8 @@ describe('workers/repository/update/branch/index', () => { 'modified_then_deleted_file', ], }, - upgrades: [ + upgrades: partial([ { - ...getConfig(), depName: 'some-dep-name-1', postUpgradeTasks: { executionMode: 'update', @@ -1719,9 +1717,8 @@ describe('workers/repository/update/branch/index', () => { 'modified_then_deleted_file', ], }, - } as BranchUpgradeConfig, + }, { - ...getConfig(), depName: 'some-dep-name-2', postUpgradeTasks: { executionMode: 'update', @@ -1733,8 +1730,8 @@ describe('workers/repository/update/branch/index', () => { 'modified_then_deleted_file', ], }, - } as BranchUpgradeConfig, - ], + }, + ]), }; const result = await branchWorker.processBranch(inconfig); @@ -1856,9 +1853,8 @@ describe('workers/repository/update/branch/index', () => { 'modified_then_deleted_file', ], }, - upgrades: [ + upgrades: partial([ { - ...getConfig(), depName: 'some-dep-name-1', postUpgradeTasks: { executionMode: 'branch', @@ -1870,9 +1866,8 @@ describe('workers/repository/update/branch/index', () => { 'modified_then_deleted_file', ], }, - } as BranchUpgradeConfig, + }, { - ...getConfig(), depName: 'some-dep-name-2', postUpgradeTasks: { executionMode: 'branch', @@ -1884,8 +1879,8 @@ describe('workers/repository/update/branch/index', () => { 'modified_then_deleted_file', ], }, - } as BranchUpgradeConfig, - ], + }, + ]), }; const result = await branchWorker.processBranch(inconfig); diff --git a/lib/workers/repository/update/pr/body/updates-table.spec.ts b/lib/workers/repository/update/pr/body/updates-table.spec.ts index 36f2154afbbcd8..e321e930eb5f4f 100644 --- a/lib/workers/repository/update/pr/body/updates-table.spec.ts +++ b/lib/workers/repository/update/pr/body/updates-table.spec.ts @@ -1,3 +1,4 @@ +import { partial } from '../../../../../../test/util'; import type { BranchConfig, BranchUpgradeConfig } from '../../../../types'; import { getPrUpdatesTable } from './updates-table'; @@ -15,7 +16,7 @@ describe('workers/repository/update/pr/body/updates-table', () => { }); it('checks results for getPrUpdatesTable', () => { - const upgrade0: BranchUpgradeConfig = { + const upgrade0 = partial({ manager: 'some-manager', branchName: 'some-branch', prBodyDefinitions: { @@ -30,9 +31,9 @@ describe('workers/repository/update/pr/body/updates-table', () => { 'Package file': '{{{packageFile}}}', }, updateType: 'lockFileMaintenance', - }; + }); - const upgrade1: BranchUpgradeConfig = { + const upgrade1 = partial({ manager: 'some-manager', branchName: 'some-branch', prBodyDefinitions: { @@ -57,9 +58,9 @@ describe('workers/repository/update/pr/body/updates-table', () => { newVersion: '1.7.0', displayFrom: '^1.7.0', displayTo: '1.7.0', - }; + }); - const upgrade2: BranchUpgradeConfig = { + const upgrade2 = partial({ manager: 'some-manager', branchName: 'some-branch', prBodyDefinitions: { @@ -85,7 +86,7 @@ describe('workers/repository/update/pr/body/updates-table', () => { newVersion: '6.2.3', displayFrom: '^6.2.3', displayTo: '6.2.3', - }; + }); // TODO #7154 allow or filter undefined const upgrade3 = undefined as never; const configObj: BranchConfig = { diff --git a/lib/workers/repository/update/pr/changelog/github.spec.ts b/lib/workers/repository/update/pr/changelog/github.spec.ts index 7d1e4c746c72e1..84419c7e26ff32 100644 --- a/lib/workers/repository/update/pr/changelog/github.spec.ts +++ b/lib/workers/repository/update/pr/changelog/github.spec.ts @@ -10,7 +10,7 @@ import { getChangeLogJSON } from '.'; jest.mock('../../../../../modules/datasource/npm'); -const upgrade: BranchUpgradeConfig = { +const upgrade = partial({ manager: 'some-manager', branchName: '', depName: 'renovate', @@ -31,7 +31,7 @@ const upgrade: BranchUpgradeConfig = { { version: '2.4.2', releaseTimestamp: '2017-12-24T03:20:46.238Z' }, { version: '2.5.2' }, ], -}; +}); describe('workers/repository/update/pr/changelog/github', () => { afterEach(() => { @@ -369,7 +369,7 @@ describe('workers/repository/update/pr/changelog/github', () => { ]) ); - const upgradeData: BranchUpgradeConfig = { + const upgradeData = partial({ manager: 'some-manager', branchName: '', depName: 'correctPrefix/target', @@ -382,7 +382,7 @@ describe('workers/repository/update/pr/changelog/github', () => { { version: '1.0.1', gitRef: '123456' }, { version: '0.1.1', gitRef: 'npm_1.0.0' }, ], - }; + }); expect( await getChangeLogJSON({ ...upgradeData, diff --git a/lib/workers/repository/update/pr/changelog/gitlab.spec.ts b/lib/workers/repository/update/pr/changelog/gitlab.spec.ts index 92108071fb819f..5f9828046e31e3 100644 --- a/lib/workers/repository/update/pr/changelog/gitlab.spec.ts +++ b/lib/workers/repository/update/pr/changelog/gitlab.spec.ts @@ -1,4 +1,5 @@ import * as httpMock from '../../../../../../test/http-mock'; +import { partial } from '../../../../../../test/util'; import * as semverVersioning from '../../../../../modules/versioning/semver'; import * as hostRules from '../../../../../util/host-rules'; import type { BranchUpgradeConfig } from '../../../../types'; @@ -6,7 +7,7 @@ import { getChangeLogJSON } from '.'; jest.mock('../../../../../modules/datasource/npm'); -const upgrade: BranchUpgradeConfig = { +const upgrade = partial({ manager: 'some-manager', branchName: '', endpoint: 'https://gitlab.com/api/v4/ ', @@ -26,7 +27,7 @@ const upgrade: BranchUpgradeConfig = { { version: '5.6.0', releaseTimestamp: '2020-02-13T15:37:00.000Z' }, { version: '5.6.1' }, ], -}; +}); const matchHost = 'https://gitlab.com/'; diff --git a/lib/workers/repository/update/pr/changelog/index.spec.ts b/lib/workers/repository/update/pr/changelog/index.spec.ts index c99c2f0e877a06..51748a88e5aaf0 100644 --- a/lib/workers/repository/update/pr/changelog/index.spec.ts +++ b/lib/workers/repository/update/pr/changelog/index.spec.ts @@ -14,7 +14,7 @@ const githubApiHost = 'https://api.github.com'; const githubTagsMock = jest.spyOn(githubGraphql, 'queryTags'); const githubReleasesMock = jest.spyOn(githubGraphql, 'queryReleases'); -const upgrade: BranchConfig = partial({ +const upgrade = partial({ endpoint: 'https://api.github.com/', depName: 'renovate', versioning: semverVersioning.id, diff --git a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts index 25ccfaccf02142..9810c7dba4ad97 100644 --- a/lib/workers/repository/update/pr/changelog/release-notes.spec.ts +++ b/lib/workers/repository/update/pr/changelog/release-notes.spec.ts @@ -97,14 +97,14 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { it('returns input if invalid', async () => { const input = { a: 1 }; expect( - await addReleaseNotes(input as never, {} as BranchUpgradeConfig) + await addReleaseNotes(input as never, partial()) ).toEqual(input); - expect(await addReleaseNotes(null, {} as BranchUpgradeConfig)).toBeNull(); expect( - await addReleaseNotes({ versions: [] }, {} as BranchUpgradeConfig) - ).toStrictEqual({ - versions: [], - }); + await addReleaseNotes(null, partial()) + ).toBeNull(); + expect( + await addReleaseNotes({ versions: [] }, partial()) + ).toStrictEqual({ versions: [] }); }); it('returns ChangeLogResult', async () => { @@ -117,7 +117,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { versions: [{ version: '3.10.0', compare: { url: '' } }], }; expect( - await addReleaseNotes(input as never, {} as BranchUpgradeConfig) + await addReleaseNotes(input as never, partial()) ).toEqual({ a: 1, hasReleaseNotes: false, @@ -151,7 +151,9 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { }), ], } as ChangeLogResult; - expect(await addReleaseNotes(input, {} as BranchUpgradeConfig)).toEqual({ + expect( + await addReleaseNotes(input, partial()) + ).toEqual({ a: 1, hasReleaseNotes: false, project: { @@ -328,7 +330,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.0', gitRef: '1.0.0', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toBeNull(); }); @@ -363,7 +365,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -405,7 +407,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: '', @@ -447,7 +449,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body\n', @@ -489,7 +491,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body\n', @@ -531,7 +533,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toBeNull(); }); @@ -566,7 +568,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -610,7 +612,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -654,7 +656,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -697,7 +699,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body [#123](https://github.com/some/other-repository/issues/123), [#124](https://github.com/some/yet-other-repository/issues/124)\n', @@ -735,7 +737,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -772,7 +774,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -809,7 +811,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.1', gitRef: '1.0.1', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ body: 'some body #123, [#124](https://gitlab.com/some/yet-other-repository/issues/124)', @@ -876,7 +878,7 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.0', gitRef: '1.0.0', }), - {} as BranchUpgradeConfig + partial() ); expect(res).toEqual({ url: 'correct/url/tag.com', @@ -910,7 +912,9 @@ describe('workers/repository/update/pr/changelog/release-notes', () => { version: '1.0.0', gitRef: '1.0.0', }), - { extractVersion: 'app-(?[0-9.]*)' } as BranchUpgradeConfig + partial({ + extractVersion: 'app-(?[0-9.]*)', + }) ); expect(res).toEqual({ url: 'correct/url/tag.com', diff --git a/lib/workers/repository/update/pr/index.spec.ts b/lib/workers/repository/update/pr/index.spec.ts index 72abd9f414a45e..425bc8d3bd6232 100644 --- a/lib/workers/repository/update/pr/index.spec.ts +++ b/lib/workers/repository/update/pr/index.spec.ts @@ -1,5 +1,12 @@ import { DateTime } from 'luxon'; -import { git, logger, mocked, platform, scm } from '../../../../../test/util'; +import { + git, + logger, + mocked, + partial, + platform, + scm, +} from '../../../../../test/util'; import { GlobalConfig } from '../../../../config/global'; import { PLATFORM_INTEGRATION_UNAUTHORIZED, @@ -620,7 +627,7 @@ describe('workers/repository/update/pr/index', () => { date: '', }; - const dummyUpgrade: BranchUpgradeConfig = { + const dummyUpgrade = partial({ branchName: sourceBranch, depType: 'foo', depName: 'bar', @@ -642,7 +649,7 @@ describe('workers/repository/update/pr/index', () => { { ...dummyRelease, version: '4.5.6' }, ], }, - }; + }); it('processes changelogs', async () => { platform.createPr.mockResolvedValueOnce(pr); @@ -695,11 +702,11 @@ describe('workers/repository/update/pr/index', () => { it('removes duplicate changelogs', async () => { platform.createPr.mockResolvedValueOnce(pr); - const upgrade: BranchUpgradeConfig = { + const upgrade = partial({ ...dummyUpgrade, sourceUrl: 'https://github.com/foo/bar', sourceDirectory: '/src', - }; + }); const res = await ensurePr({ ...config, upgrades: [upgrade, upgrade, { ...upgrade, depType: 'test' }], diff --git a/lib/workers/repository/updates/generate.spec.ts b/lib/workers/repository/updates/generate.spec.ts index d5f409246cc65d..2f436d4bf62d8a 100644 --- a/lib/workers/repository/updates/generate.spec.ts +++ b/lib/workers/repository/updates/generate.spec.ts @@ -1,5 +1,5 @@ import { codeBlock } from 'common-tags'; -import { getConfig } from '../../../../test/util'; +import { getConfig, partial } from '../../../../test/util'; import type { RenovateConfig, UpdateType } from '../../../config/types'; import { NpmDatasource } from '../../../modules/datasource/npm'; import type { BranchUpgradeConfig } from '../../types'; @@ -15,7 +15,7 @@ beforeEach(() => { describe('workers/repository/updates/generate', () => { describe('generateBranchConfig()', () => { it('does not group single upgrade', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -28,7 +28,7 @@ describe('workers/repository/updates/generate', () => { foo: 2, }, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.foo).toBe(1); expect(res.groupName).toBeUndefined(); @@ -36,14 +36,14 @@ describe('workers/repository/updates/generate', () => { }); it('handles lockFileMaintenance', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', branchName: 'some-branch', prTitle: 'some-title', isLockFileMaintenance: true, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res).toMatchSnapshot({ branchName: 'some-branch', @@ -60,7 +60,7 @@ describe('workers/repository/updates/generate', () => { }); it('handles lockFileUpdate', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', branchName: 'some-branch', @@ -72,7 +72,7 @@ describe('workers/repository/updates/generate', () => { newValue: '^1.0.0', newVersion: '1.0.1', }, - ]; + ]); const res = generateBranchConfig(branch); expect(res).toMatchSnapshot({ branchName: 'some-branch', @@ -102,7 +102,7 @@ describe('workers/repository/updates/generate', () => { }); it('does not group same upgrades', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -125,14 +125,14 @@ describe('workers/repository/updates/generate', () => { foo: 2, }, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.foo).toBe(1); expect(res.groupName).toBeUndefined(); }); it('groups multiple upgrades same version', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -191,7 +191,7 @@ describe('workers/repository/updates/generate', () => { releaseTimestamp: '2017-02-06T20:01:41+00:00', automerge: false, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.foo).toBe(2); expect(res.groupName).toBeDefined(); @@ -204,7 +204,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups major updates with different versions but same newValue, no recreateClosed', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -233,14 +233,14 @@ describe('workers/repository/updates/generate', () => { isMajor: true, newMajor: 5, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.groupName).toBeDefined(); expect(res.recreateClosed).toBeFalsy(); }); it('groups multiple digest updates immortally', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -263,7 +263,7 @@ describe('workers/repository/updates/generate', () => { newDigest: 'sha256:abcdef987654321', isDigest: true, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.groupName).toBeDefined(); expect(res.recreateClosed).toBeTrue(); @@ -340,7 +340,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple upgrades different version', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'depB', @@ -379,7 +379,7 @@ describe('workers/repository/updates/generate', () => { updateType: 'minor', separateMinorPatch: true, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res).toMatchObject({ foo: 2, @@ -393,7 +393,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple upgrades different version but same value', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'depB', @@ -426,7 +426,7 @@ describe('workers/repository/updates/generate', () => { }, releaseTimestamp: '2017-02-08T20:01:41+00:00', }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.foo).toBe(2); expect(res.singleVersion).toBeUndefined(); @@ -436,7 +436,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple upgrades different value but same version', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'depB', @@ -469,7 +469,7 @@ describe('workers/repository/updates/generate', () => { }, releaseTimestamp: '2017-02-08T20:01:41+00:00', }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.foo).toBe(2); expect(res.singleVersion).toBeUndefined(); @@ -479,7 +479,7 @@ describe('workers/repository/updates/generate', () => { }); it('groups multiple digest updates', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'foo/bar', @@ -510,7 +510,7 @@ describe('workers/repository/updates/generate', () => { foo: 2, }, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.foo).toBe(2); expect(res.singleVersion).toBeUndefined(); @@ -536,7 +536,7 @@ describe('workers/repository/updates/generate', () => { }); it('fixes different messages', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'depA', @@ -569,7 +569,7 @@ describe('workers/repository/updates/generate', () => { }, releaseTimestamp: '2017-02-08T20:01:41+00:00', }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.foo).toBe(1); expect(res.groupName).toBeUndefined(); @@ -693,6 +693,7 @@ describe('workers/repository/updates/generate', () => { }); it('use prettyVersion in pr title when there is a v', () => { + // TODO #7154 incompatible types const branch: BranchUpgradeConfig[] = [ { ...defaultConfig, @@ -719,6 +720,7 @@ describe('workers/repository/updates/generate', () => { }); it('use prettyVersion in pr title there is no v', () => { + // TODO #7154 incompatible types const branch: BranchUpgradeConfig[] = [ { ...defaultConfig, @@ -745,6 +747,7 @@ describe('workers/repository/updates/generate', () => { }); it('use newMajor in pr title with v', () => { + // TODO #7154 incompatible types const branch: BranchUpgradeConfig[] = [ { ...defaultConfig, @@ -769,6 +772,7 @@ describe('workers/repository/updates/generate', () => { }); it('Default commitMessageExtra pr title', () => { + // TODO #7154 incompatible types const branch: BranchUpgradeConfig[] = [ { ...defaultConfig, @@ -828,7 +832,7 @@ describe('workers/repository/updates/generate', () => { }); it('handles @types specially', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', commitBodyTable: true, @@ -865,7 +869,7 @@ describe('workers/repository/updates/generate', () => { newValue: '1.0.0', group: {}, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.recreateClosed).toBeFalse(); expect(res.groupName).toBeUndefined(); @@ -893,7 +897,7 @@ describe('workers/repository/updates/generate', () => { }); it('handles @types specially (reversed)', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -926,7 +930,7 @@ describe('workers/repository/updates/generate', () => { labels: ['a'], group: {}, }, - ]; + ]); expect(generateBranchConfig(branch)).toMatchSnapshot({ upgrades: [ { @@ -1008,7 +1012,7 @@ describe('workers/repository/updates/generate', () => { }); it('combines prBodyColumns', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', branchName: 'some-branch', @@ -1019,13 +1023,13 @@ describe('workers/repository/updates/generate', () => { branchName: 'some-branch', prBodyColumns: ['column-c', 'column-b', 'column-a'], }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.prBodyColumns).toEqual(['column-a', 'column-b', 'column-c']); }); it('sorts upgrades, without position first', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep1', @@ -1058,7 +1062,7 @@ describe('workers/repository/updates/generate', () => { newValue: '0.6.0', fileReplacePosition: undefined, }, - ]; + ]); const res = generateBranchConfig(branch); expect( res.upgrades.map((upgrade) => upgrade.fileReplacePosition) @@ -1066,7 +1070,7 @@ describe('workers/repository/updates/generate', () => { }); it('passes through pendingChecks', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -1083,14 +1087,14 @@ describe('workers/repository/updates/generate', () => { prTitle: 'some-title', pendingChecks: true, }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.pendingChecks).toBeTrue(); expect(res.upgrades).toHaveLength(2); }); it('filters pendingChecks', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -1106,14 +1110,14 @@ describe('workers/repository/updates/generate', () => { branchName: 'some-branch', prTitle: 'some-title', }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.pendingChecks).toBeUndefined(); expect(res.upgrades).toHaveLength(1); }); it('displays pending versions', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep', @@ -1137,7 +1141,7 @@ describe('workers/repository/updates/generate', () => { prTitle: 'Two pending versions', pendingVersions: ['1.1.0', '1.1.1'], }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.upgrades.map((u) => u.displayPending)).toStrictEqual([ '', @@ -1147,7 +1151,7 @@ describe('workers/repository/updates/generate', () => { }); it('merge excludeCommitPaths if appears in upgrade', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', depName: 'some-dep1', @@ -1171,7 +1175,7 @@ describe('workers/repository/updates/generate', () => { newValue: '0.9.0', excludeCommitPaths: ['some/path', 'some/other-manager/path'], }, - ]; + ]); const res = generateBranchConfig(branch); const excludeCommitPaths = res.excludeCommitPaths ?? []; expect(excludeCommitPaths.sort()).toStrictEqual( @@ -1203,19 +1207,20 @@ describe('workers/repository/updates/generate', () => { }); it('prevents issue with duplicating "v" character', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { manager: 'some-manager', branchName: 'some-branch', commitMessage: 'update to vv1.2.0', }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.prTitle).toBe('update to v1.2.0'); expect(res.commitMessage).toBe('update to v1.2.0'); }); it('apply semanticCommits and commitMessagePrefix together', () => { + // TODO #7154 incompatible types const branch: BranchUpgradeConfig[] = [ { ...defaultConfig, @@ -1236,7 +1241,7 @@ describe('workers/repository/updates/generate', () => { }); it('dedupes duplicate table rows', () => { - const branch: BranchUpgradeConfig[] = [ + const branch = partial([ { commitBodyTable: true, manager: 'some-manager', @@ -1281,7 +1286,7 @@ describe('workers/repository/updates/generate', () => { currentVersion: '5.1.1', newVersion: '5.1.2', }, - ]; + ]); const res = generateBranchConfig(branch); expect(res.commitMessage?.trim()).toBe(codeBlock` | datasource | package | from | to | @@ -1299,6 +1304,7 @@ describe('workers/repository/updates/generate', () => { }); it('using commitMessagePrefix without separator', () => { + // TODO #7154 incompatible types const branch: BranchUpgradeConfig[] = [ { ...defaultConfig,