Skip to content

Commit

Permalink
Fix unreleased compare URL
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Feb 22, 2018
1 parent cb7f5c9 commit 24fbc63
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function parseReleases (commits, remote, latestVersion, options) {
...release,
href: getCompareLink(
`${options.tagPrefix}${commit.tag}`,
`${options.tagPrefix}${release.tag}` || 'HEAD',
release.tag ? `${options.tagPrefix}${release.tag}` : 'HEAD',
remote
),
commits: release.commits.sort(sortCommits),
Expand Down
6 changes: 5 additions & 1 deletion test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ describe('run', () => {
return run(['', '', '--output', 'should-be-this.md'])
})

it('does not error when using unreleased option', () => {
it('supports unreleased option', () => {
mock('writeFile', (output, log) => {
expect(log).to.include('Unreleased')
expect(log).to.include('https://github.com/user/repo/compare/v1.0.0...HEAD')
})
return run(['', '', '--unreleased'])
})

Expand Down

0 comments on commit 24fbc63

Please sign in to comment.