Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
dgellow committed Feb 1, 2024
1 parent 02f04a2 commit 9800488
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions __snapshots__/default-changelog-notes.ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ exports['DefaultChangelogNotes buildNotes should handle BREAKING CHANGE notes 1'
* some bugfix ([sha2](https://github.com/googleapis/java-asset/commit/sha2))
`

exports['DefaultChangelogNotes buildNotes should ignore "chore: release" commits 1'] = `
## [1.2.3](https://github.com/googleapis/java-asset/compare/v1.2.2...v1.2.3) (1983-10-10)
`

exports['DefaultChangelogNotes buildNotes should ignore RELEASE AS notes 1'] = `
## [1.2.3](https://github.com/googleapis/java-asset/compare/v1.2.2...v1.2.3) (1983-10-10)
Expand Down
22 changes: 22 additions & 0 deletions test/changelog-notes/default-changelog-notes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,28 @@ describe('DefaultChangelogNotes', () => {
expect(notes).to.is.string;
safeSnapshot(notes);
});
it('should ignore "chore: release" commits', async () => {
const commits = [
{
sha: 'sha2',
message: 'chore: release main',
files: ['path1/file1.rb'],
type: 'chore',
scope: null,
bareMessage: 'release main',
notes: [],
references: [],
breaking: false,
},
];
const changelogNotes = new DefaultChangelogNotes();
const notes = await changelogNotes.buildNotes(commits, {
...notesOptions,
changelogSections: [{type: 'chore', section: 'Chores', hidden: false}],
});
expect(notes).to.is.string;
safeSnapshot(notes);
});
describe('with commit parsing', () => {
it('should handle a breaking change', async () => {
const commits = [buildMockCommit('fix!: some bugfix')];
Expand Down

0 comments on commit 9800488

Please sign in to comment.