Skip to content

Commit

Permalink
fix: added support for non-lowercased messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri Drabik committed Jan 29, 2021
1 parent 865cbe9 commit c02cebd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
7 changes: 7 additions & 0 deletions __snapshots__/valid-message-spec.js.snap-shot
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,10 @@ exports['ignores lines that start with # 1'] = {
"subject": "first line"
}

exports['parses NOnLoWeRcased message 1'] = {
"firstLine": "major(foo): add another major feature",
"type": "major",
"scope": "foo",
"subject": "add another major feature"
}

4 changes: 4 additions & 0 deletions src/valid-message-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ describe('parse message', () => {
snapshot(parse('minor(foo): add feature without breaking stuff'))
})

it('parses NOnLoWeRcased message', () => {
snapshot(parse('MaJOr(foo): add another major feature'))
})

it('rejects invalid message', () => {
const message = 'free form text'
const parsed = parse(message)
Expand Down
2 changes: 1 addition & 1 deletion src/valid-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function parseMessage (str) {
debug('parsing message "%s"', str)

la(check.string(str), 'expected string message', str)
str = removeComments(str).trim()
str = removeComments(str).trim().toLowerCase()

var match = PATTERN.exec(str)

Expand Down

0 comments on commit c02cebd

Please sign in to comment.