Skip to content

Commit

Permalink
test(format-commit-message): add failing test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
tomchentw committed Nov 28, 2017
1 parent 3fdd7fa commit b37bc66
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var stream = require('stream')
var mockGit = require('mock-git')
var mockery = require('mockery')
var semver = require('semver')
var formatCommitMessage = require('./lib/format-commit-message')
var cli = require('./command')
var standardVersion = require('./index')

Expand Down Expand Up @@ -101,6 +102,18 @@ function getPackageVersion () {
return JSON.parse(fs.readFileSync('package.json', 'utf-8')).version
}

describe('format-commit-message', function () {
it('works for no %s', function () {
formatCommitMessage('chore(release): 1.0.0', '1.0.0').should.equal('chore(release): 1.0.0')
})
it('works for one %s', function () {
formatCommitMessage('chore(release): %s', '1.0.0').should.equal('chore(release): 1.0.0')
})
it('works for two %s', function () {
formatCommitMessage('chore(release): %s \n\n* CHANGELOG: https://github.com/conventional-changelog/standard-version/blob/v%s/CHANGELOG.md', '1.0.0').should.equal('chore(release): 1.0.0 \n\n* CHANGELOG: https://github.com/conventional-changelog/standard-version/blob/v1.0.0/CHANGELOG.md')
})
})

describe('cli', function () {
beforeEach(initInTempFolder)
afterEach(finishTemp)
Expand Down

0 comments on commit b37bc66

Please sign in to comment.