🐛 Fixed changelog entry with emoji not being detected

no issue
This commit is contained in:
kirrg001 2019-03-14 16:51:18 +01:00
parent 89c555e29f
commit d7c930d278
2 changed files with 5 additions and 3 deletions

View File

@ -3,7 +3,7 @@ const _ = require('lodash');
const timestamp = /^[0-9]{10} /;
const separator = /^\* /;
const hash = /^\[[0-9a-f]{9}\]/;
const hash = /^\[[0-9a-f]{0,10}\]/;
const url = /^\(https?:\/\/[^)]+\) /;
const getCommitMessageFromLine = line => line
@ -21,6 +21,7 @@ module.exports.filterEmojiCommits = (content) => {
const commitMessage = getCommitMessageFromLine(currentLine);
const match = emojiRegex().exec(commitMessage);
if (match && match.index === 0) {
return emojiLines.concat(`* ${commitMessage}`);
}

View File

@ -27,10 +27,11 @@ describe('Utils', function () {
it('emoji commits found: just another format', function () {
const result = lib.utils.filterEmojiCommits([
'* [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) Version bump to 2.17.1 - Name',
'* [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) 👻 Version bump to 2.17.1 - Name'
'* [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) 👻 Version bump to 2.17.1 - Name',
'* [e456ae2](https://github.com/kirrg001/testing/commit/e456ae2) 🐝 tzZZ - kirrg001'
]);
result.length.should.eql(1);
result.length.should.eql(2);
});
});
});