Skip to content

Commit 26749d0

Browse files
committed
Correct this argument
1 parent f264e0c commit 26749d0

File tree

4 files changed

+43
-37
lines changed

4 files changed

+43
-37
lines changed

src/monorepo-workflow-operations.test.ts

Lines changed: 29 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ async function setupFollowMonorepoWorkflow({
198198
.calledWith(project, releasePlan, stderr)
199199
.mockResolvedValue();
200200
when(captureChangesInReleaseBranchSpy)
201-
.calledWith({
202-
repositoryDirectoryPath: projectDirectoryPath,
201+
.calledWith(projectDirectoryPath, {
203202
releaseDate,
204203
releaseNumber,
205204
})
@@ -290,11 +289,13 @@ describe('monorepo-workflow-utils', () => {
290289
stderr,
291290
});
292291

293-
expect(captureChangesInReleaseBranchSpy).toHaveBeenCalledWith({
294-
repositoryDirectoryPath: projectDirectoryPath,
295-
releaseDate,
296-
releaseNumber,
297-
});
292+
expect(captureChangesInReleaseBranchSpy).toHaveBeenCalledWith(
293+
projectDirectoryPath,
294+
{
295+
releaseDate,
296+
releaseNumber,
297+
},
298+
);
298299
});
299300
});
300301

@@ -588,11 +589,13 @@ describe('monorepo-workflow-utils', () => {
588589
stderr,
589590
});
590591

591-
expect(captureChangesInReleaseBranchSpy).toHaveBeenCalledWith({
592-
repositoryDirectoryPath: projectDirectoryPath,
593-
releaseDate,
594-
releaseNumber,
595-
});
592+
expect(captureChangesInReleaseBranchSpy).toHaveBeenCalledWith(
593+
projectDirectoryPath,
594+
{
595+
releaseDate,
596+
releaseNumber,
597+
},
598+
);
596599
});
597600
});
598601

@@ -702,11 +705,13 @@ describe('monorepo-workflow-utils', () => {
702705
stderr,
703706
});
704707

705-
expect(captureChangesInReleaseBranchSpy).toHaveBeenCalledWith({
706-
repositoryDirectoryPath: projectDirectoryPath,
707-
releaseDate,
708-
releaseNumber,
709-
});
708+
expect(captureChangesInReleaseBranchSpy).toHaveBeenCalledWith(
709+
projectDirectoryPath,
710+
{
711+
releaseDate,
712+
releaseNumber,
713+
},
714+
);
710715
});
711716
});
712717

@@ -1004,11 +1009,13 @@ describe('monorepo-workflow-utils', () => {
10041009
stderr,
10051010
});
10061011

1007-
expect(captureChangesInReleaseBranchSpy).toHaveBeenCalledWith({
1008-
repositoryDirectoryPath: projectDirectoryPath,
1009-
releaseDate,
1010-
releaseNumber,
1011-
});
1012+
expect(captureChangesInReleaseBranchSpy).toHaveBeenCalledWith(
1013+
projectDirectoryPath,
1014+
{
1015+
releaseDate,
1016+
releaseNumber,
1017+
},
1018+
);
10121019
});
10131020
});
10141021

src/monorepo-workflow-operations.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ export async function followMonorepoWorkflow({
114114
});
115115
await executeReleasePlan(project, releasePlan, stderr);
116116
await removeFile(releaseSpecificationPath);
117-
await captureChangesInReleaseBranch({
118-
repositoryDirectoryPath: project.directoryPath,
117+
await captureChangesInReleaseBranch(project.directoryPath, {
119118
releaseDate: releasePlan.releaseDate,
120119
releaseNumber: releasePlan.releaseNumber,
121120
});

src/repo.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,7 @@ describe('repo', () => {
9696
'getStdoutFromCommand',
9797
);
9898

99-
await captureChangesInReleaseBranch({
100-
repositoryDirectoryPath: '/path/to/project',
99+
await captureChangesInReleaseBranch('/path/to/project', {
101100
releaseDate: new Date(2022, 6, 22),
102101
releaseNumber: 12345,
103102
});

src/repo.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,21 @@ export async function getRepositoryHttpsUrl(
8989
* of the new release).
9090
* 3. Switches to that branch.
9191
*
92-
* @param args - The arguments.
93-
* @param args.repositoryDirectoryPath - The path to the repository directory.
92+
* @param repositoryDirectoryPath - The path to the repository directory.
93+
* @param args - The remainder of the arguments.
9494
* @param args.releaseDate - The release date.
9595
* @param args.releaseNumber - The release number.
9696
*/
97-
export async function captureChangesInReleaseBranch({
98-
repositoryDirectoryPath,
99-
releaseDate,
100-
releaseNumber,
101-
}: {
102-
repositoryDirectoryPath: string;
103-
releaseDate: Date;
104-
releaseNumber: number;
105-
}) {
97+
export async function captureChangesInReleaseBranch(
98+
repositoryDirectoryPath: string,
99+
{
100+
releaseDate,
101+
releaseNumber,
102+
}: {
103+
releaseDate: Date;
104+
releaseNumber: number;
105+
},
106+
) {
106107
const releaseDateAsISO = formatDateAsISO(releaseDate, {
107108
representation: 'date',
108109
});

0 commit comments

Comments
 (0)