Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cookpete committed Dec 21, 2017
1 parent 89ab994 commit 2a74da4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('parseReleases', () => {
expect(releases[0].href).to.equal('https://bitbucket.org/user/repo/compare/v1.0.0%0Dv0.1.0')
})

it('supports a package version override', () => {
it('supports a version override', () => {
const result = parseReleases(commits, origins.github, 'v3.0.0', options)
expect(result).to.be.an('array')
expect(result[0]).to.have.property('tag', 'v3.0.0')
Expand Down
27 changes: 20 additions & 7 deletions test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,6 @@ describe('run', () => {
})
})

it('supports unreleased option', () => {
return run(['', '', '--unreleased']).then(message => {
expect(message).to.be.a('string')
expect(message).to.have.string('bytes written to')
})
})

it('uses options from package.json', async () => {
const expected = await readFile(join(__dirname, 'data', 'template-keepachangelog.md'), 'utf-8')

Expand All @@ -83,6 +76,20 @@ describe('run', () => {
})
})

it('does not error when using unreleased option', () => {
return run(['', '', '--unreleased']).then(message => {
expect(message).to.be.a('string')
expect(message).to.have.string('bytes written to')
})
})

it('does not error when using latest version option', () => {
return run(['', '', '--latest-version', '3.0.0']).then(message => {
expect(message).to.be.a('string')
expect(message).to.have.string('bytes written to')
})
})

it('throws an error when no package found', done => {
run(['', '', '--package'])
.then(() => done('Should throw an error'))
Expand All @@ -94,4 +101,10 @@ describe('run', () => {
.then(() => done('Should throw an error'))
.catch(() => done())
})

it('throws an error when given an invalid latest version', done => {
run(['', '', '--latest-version', 'invalid'])
.then(() => done('Should throw an error'))
.catch(() => done())
})
})

0 comments on commit 2a74da4

Please sign in to comment.