Skip to content

Commit

Permalink
chore: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
james-prado committed Aug 14, 2022
1 parent 32d5729 commit 9d99b2e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/conventional-changelog-conventionalcommits/test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ betterThanBefore.setups([
'chore: release at different version',
'Release-As: v3.0.2'
])
},
function () {
gitDummyCommit(['feat(awesome): remove duplicates', 'fixes A of #107', 'fixes B of #107', ' closes #107'])
}
])

Expand Down Expand Up @@ -614,4 +617,22 @@ describe('conventionalcommits.org preset', function () {
done()
}))
})
it('should remove all duplicate issues', function (done) {
preparing(12)

conventionalChangelogCore({
config: getPreset({
removeDuplicateIssues: true
})
})
.on('error', function (err) {
done(err)
})
.pipe(through(function (chunk) {
chunk = chunk.toString()
const matches = [...chunk.matchAll(/\[#107\]\(.*\)/g)]
expect(chunk).to.satisfy(() => matches.length === 1)
done()
}))
})
})

0 comments on commit 9d99b2e

Please sign in to comment.