Skip to content

Commit

Permalink
test(npm): update makeRelease with inOldVersionBranch and fix ts error
Browse files Browse the repository at this point in the history
  • Loading branch information
jackw committed Jan 24, 2024
1 parent 50fb9a2 commit fce0e96
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions plugins/npm/__tests__/npm.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1650,6 +1650,7 @@ describe("makeRelease", () => {
logger: dummyLog(),
prefixRelease: (str) => str,
git: { publish } as any,
inOldVersionBranch: (bool) => bool,
release: {
makeChangelog: () => ({
generateReleaseNotes: (commits: IExtendedCommit[]) =>
Expand All @@ -1661,6 +1662,7 @@ describe("makeRelease", () => {
await hooks.makeRelease.promise({
newVersion: "0.1.2",
from: "",
to: "",
isPrerelease: false,
fullReleaseNotes: "",
commits: [
Expand All @@ -1684,12 +1686,16 @@ describe("makeRelease", () => {
expect(publish).toHaveBeenCalledWith(
"update package 1",
"@packages/a",
false
false,
undefined,
true
);
expect(publish).toHaveBeenCalledWith(
"update package 2",
"@packages/b",
false
false,
undefined,
true
);
});
});
Expand Down
8 changes: 7 additions & 1 deletion plugins/npm/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,13 @@ export default class NPMPlugin implements IPlugin {
auto.logger.log.info(`Using release notes:\n${releaseNotes}`);

// 2. make a release for just that package
return auto.git?.publish(releaseNotes, tag, options.isPrerelease, undefined, !auto.inOldVersionBranch());
return auto.git?.publish(
releaseNotes,
tag,
options.isPrerelease,
undefined,
!auto.inOldVersionBranch()
);
})
);

Expand Down

0 comments on commit fce0e96

Please sign in to comment.