Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use satisfies #20781

Merged
merged 2 commits into from
Mar 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 16 additions & 12 deletions lib/workers/repository/update/branch/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@ describe('workers/repository/update/branch/index', () => {
errors: [],
warnings: [],
upgrades: partial<BranchUpgradeConfig>([{ depName: 'some-dep-name' }]),
} as BranchConfig;
baseBranch: 'base-branch',
manager: 'some-manager',
major: undefined,
} satisfies BranchConfig;
schedule.isScheduledNow.mockReturnValue(true);
commit.commitFilesToBranch.mockResolvedValue('123test');

Expand Down Expand Up @@ -759,7 +762,7 @@ describe('workers/repository/update/branch/index', () => {
prCreation: 'not-pending',
commitBody: '[skip-ci]',
fetchReleaseNotes: true,
} as BranchConfig;
} satisfies BranchConfig;
mockedFunction(needsChangelogs).mockReturnValueOnce(true);
scm.getBranchCommit.mockResolvedValue('123test'); //TODO:not needed?
expect(await branchWorker.processBranch(inconfig)).toEqual({
Expand Down Expand Up @@ -1108,7 +1111,7 @@ describe('workers/repository/update/branch/index', () => {
updateType: 'lockFileMaintenance',
reuseExistingBranch: false,
updatedArtifacts: [{ type: 'deletion', path: 'dummy' }],
} as BranchConfig;
} satisfies BranchConfig;
expect(await branchWorker.processBranch(inconfig)).toEqual({
branchExists: true,
updatesVerified: true,
Expand Down Expand Up @@ -1199,7 +1202,7 @@ describe('workers/repository/update/branch/index', () => {
updateType: 'lockFileMaintenance',
reuseExistingBranch: false,
updatedArtifacts: [{ type: 'deletion', path: 'dummy' }],
} as BranchConfig;
} satisfies BranchConfig;
expect(await branchWorker.processBranch(inconfig)).toEqual({
branchExists: true,
updatesVerified: true,
Expand Down Expand Up @@ -1236,7 +1239,7 @@ describe('workers/repository/update/branch/index', () => {
const inconfig = {
...config,
updatedArtifacts: [{ type: 'deletion', path: 'dummy' }],
} as BranchConfig;
} satisfies BranchConfig;
expect(await branchWorker.processBranch(inconfig)).toEqual({
branchExists: true,
prNo: undefined,
Expand Down Expand Up @@ -1304,7 +1307,7 @@ describe('workers/repository/update/branch/index', () => {
...config,
reuseExistingBranch: false,
updatedArtifacts: [{ type: 'deletion', path: 'dummy' }],
} as BranchConfig;
} satisfies BranchConfig;
expect(await branchWorker.processBranch(inconfig)).toEqual({
branchExists: true,
updatesVerified: true,
Expand Down Expand Up @@ -1343,7 +1346,7 @@ describe('workers/repository/update/branch/index', () => {
...config,
dependencyDashboardChecks: { 'renovate/some-branch': 'true' },
updatedArtifacts: [{ type: 'deletion', path: 'dummy' }],
} as BranchConfig;
} satisfies BranchConfig;
expect(await branchWorker.processBranch(inconfig)).toEqual({
branchExists: true,
updatesVerified: true,
Expand Down Expand Up @@ -1421,16 +1424,17 @@ describe('workers/repository/update/branch/index', () => {
},
upgrades: [
{
...getConfig(),
depName: 'some-dep-name',
postUpgradeTasks: {
executionMode: 'update',
commands: ['echo {{{versioning}}}', 'disallowed task'],
fileFilters: ['modified_file', 'deleted_file'],
},
},
branchName: 'renovate/some-branch',
manager: 'some-manager',
} satisfies BranchUpgradeConfig,
],
} as BranchConfig;
} satisfies BranchConfig;
const result = await branchWorker.processBranch(inconfig);
expect(result).toEqual({
branchExists: true,
Expand Down Expand Up @@ -1606,7 +1610,7 @@ describe('workers/repository/update/branch/index', () => {
},
}),
],
} as BranchConfig;
} satisfies BranchConfig;
const result = await branchWorker.processBranch(inconfig);
expect(result).toEqual({
branchExists: true,
Expand Down Expand Up @@ -2134,7 +2138,7 @@ describe('workers/repository/update/branch/index', () => {
const inconfig = {
...config,
prCreation: 'not-pending',
} as BranchConfig;
} satisfies BranchConfig;
expect(await branchWorker.processBranch(inconfig)).toEqual({
branchExists: true,
updatesVerified: true,
Expand Down