2019-03-12 23:53:32 +03:00
|
|
|
// Switch these lines once there are useful utils
|
|
|
|
// const testUtils = require('./utils');
|
|
|
|
require('./utils');
|
|
|
|
|
|
|
|
const lib = require('../lib');
|
|
|
|
|
|
|
|
describe('Utils', function () {
|
|
|
|
describe('filterEmojiCommits', function () {
|
|
|
|
it('no emoji commits found', function () {
|
|
|
|
const result = lib.utils.filterEmojiCommits([
|
2019-03-13 18:02:52 +03:00
|
|
|
'1234567890 * [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) Version bump to 2.17.1 - Name',
|
|
|
|
'1234567890 * [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) Version bump to 2.17.1 - Name'
|
2019-03-12 23:53:32 +03:00
|
|
|
]);
|
|
|
|
|
|
|
|
result.length.should.eql(0);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('emoji commits found', function () {
|
|
|
|
const result = lib.utils.filterEmojiCommits([
|
2019-03-13 18:02:52 +03:00
|
|
|
'1234567890 * [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) Version bump to 2.17.1 - Name',
|
|
|
|
'1234567890 * [f6f35ebcd](https://github.com/TryGhost/Ghost/commit/f6f35ebcd) 👻 Version bump to 2.17.1 - Name'
|
2019-03-12 23:53:32 +03:00
|
|
|
]);
|
|
|
|
|
|
|
|
result.length.should.eql(1);
|
|
|
|
});
|
2019-03-14 18:35:48 +03:00
|
|
|
|
|
|
|
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',
|
2019-03-14 18:51:18 +03:00
|
|
|
'* [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'
|
2019-03-14 18:35:48 +03:00
|
|
|
]);
|
|
|
|
|
2019-03-14 18:51:18 +03:00
|
|
|
result.length.should.eql(2);
|
2019-03-14 18:35:48 +03:00
|
|
|
});
|
2019-03-12 23:53:32 +03:00
|
|
|
});
|
|
|
|
});
|