Skip to content

Commit

Permalink
Make the release-post script more tolerant (#838)
Browse files Browse the repository at this point in the history
Fixes: #837
  • Loading branch information
lpinca authored and stevemao committed Jul 23, 2016
1 parent 9b8861e commit e228b32
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/release-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function fetchChangelog (version) {
const rxSection = new RegExp(`<a id="${version}"></a>\\n([\\s\\S]+?)(?:\\n<a id="|$)`)
const matches = rxSection.exec(data)
return matches
? matches[1]
? matches[1].trim()
: Promise.reject(new Error(`Couldn't find matching changelog for ${version}`))
})
}
Expand Down
2 changes: 2 additions & 0 deletions tests/scripts/release-post.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ test('fetchChangelog(<version>)', (t) => {
.replyWithFile(200, changelogFixture)

releasePost.fetchChangelog('4.1.1').then((changelog) => {
t.true(changelog.charAt(changelog.length - 1) !== '\n')
t.true(changelog.charAt(0) !== '\n')
t.true(changelog.includes('Fixed a bug introduced in v4.1.0'))
t.true(github.isDone(), 'githubusercontent.com was requested')

Expand Down

0 comments on commit e228b32

Please sign in to comment.