Skip to content

Commit

Permalink
test: for changelog based on tags with names
Browse files Browse the repository at this point in the history
  • Loading branch information
restfulhead committed Feb 23, 2024
1 parent 6378457 commit 210391a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions packages/core/src/__tests__/release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,31 @@ describe("Release", () => {
expect(writeSpy.mock.calls[0][1].includes(`1.0.1`)).toBe(true);
});

test("creates changelog with named tag", async () => {
const gh = new Release(git, {
noVersionPrefix: false,
prereleaseBranches: ["next"],
labels: defaultLabels,
baseBranch: "main",
});
await gh.addToChangelog("# My new Notes", "my-tag-name-v1.0.0", "v1.0.0");

expect(writeSpy.mock.calls[0][1].includes(`1.0.1`)).toBe(true);
});

test("creates changelog with named tag and version prefix", async () => {
const gh = new Release(git, {
noVersionPrefix: true,
prereleaseBranches: ["next"],
labels: defaultLabels,
baseBranch: "main",
});
await gh.addToChangelog("# My new Notes", "my-tag-name-1.0.0", "1.0.0");

expect(writeSpy.mock.calls[0][1].includes(`1.0.1`)).toBe(true);
});


test("prepends to old changelog", async () => {
const gh = new Release(git, config);

Expand Down

0 comments on commit 210391a

Please sign in to comment.