Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
jondricek committed Dec 31, 2024
1 parent b2d837b commit 9e518c1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/__tests__/changelogToGithubRelease.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import { changelogToGithubRelease } from '../changelogToGithubRelease.js';
const changelog = `
# Changelog
## 1.1.0 - 2024-12-31
- ddd [#123](https://github.com/foo/bar/pull/123) ([@user](https://github.com/user)).
- eee.
## 1.0.0
- aaa [#123](https://github.com/foo/bar/pull/123) ([@user](https://github.com/user)).
- bbb.
Expand All @@ -14,6 +18,16 @@ const changelog = `
- ccc.
`;

test('rewrite change items for version with date in heading', async () => {
const result = await changelogToGithubRelease(changelog, '1.1.0');
assert.equal(
result,
`* ddd #123 (@user).
* eee.
`,
);
});

test('rewrite change items matching specified version', async () => {
const result = await changelogToGithubRelease(changelog, '1.0.0');
assert.equal(
Expand Down

0 comments on commit 9e518c1

Please sign in to comment.