Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@exadev/eslint-config": "2.35.0",
"@semantic-release/changelog": "^7.0.0",
"@semantic-release/git": "^11.0.1",
"@semantic-release/release-notes-generator": "14.1.1",
"@types/jsdom": "^30.0.0",
"@types/node": "^26.6.3",
"@types/semver": "7.8.0",
Expand All @@ -48,7 +49,7 @@
"@typescript/native": "npm:typescript@^7.0.2",
"@vitest/coverage-v8": "^5.0.2",
"commitizen": "^4.3.2",
"conventional-changelog-conventionalcommits": "^10.4.0",
"conventional-changelog-conventionalcommits": "^9.3.1",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^10.11.0",
"eslint-config-prettier": "^10.1.8",
Expand Down
18 changes: 16 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions src/release-notes.integration.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { describe, expect, it } from "vitest";
import { generateNotes } from "@semantic-release/release-notes-generator";

/**
* Renders release notes through the same preset semantic-release is configured with. The preset
* and the changelog writer that semantic-release's notes generator loads have to agree on a major
* version, and a mismatch only otherwise shows up when a release runs.
*/
describe("release notes", () => {
it("renders a release with the configured conventional commits preset", async () => {
const notes = await generateNotes(
{ preset: "conventionalcommits" },
{
cwd: process.cwd(),
options: { repositoryUrl: "https://github.com/ExaDev/markmv.git" },
lastRelease: { gitTag: "v1.0.0" },
nextRelease: { gitTag: "v1.1.0", version: "1.1.0" },
commits: [
{
hash: "abc1234abc1234abc1234abc1234abc1234abc12",
message: "feat(cli): start the servers with markmv api",
committerDate: new Date().toISOString(),
},
],
},
);

expect(notes).toContain("start the servers with markmv api");
});
});
17 changes: 17 additions & 0 deletions src/test-support/release-notes-generator.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/** The part of semantic-release's notes generator that the release notes test calls; the package ships no declarations. */
declare module "@semantic-release/release-notes-generator" {
export function generateNotes(
pluginConfig: { preset: string },
context: {
cwd: string;
options: { repositoryUrl: string };
lastRelease: { gitTag: string };
nextRelease: { gitTag: string; version: string };
commits: readonly {
hash: string;
message: string;
committerDate: string;
}[];
},
): Promise<string>;
}
Loading