Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdlg committed Aug 29, 2017
2 parents ae69fd1 + a81902d commit 91bbaf0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"eslint-plugin-unicorn": "^2.1.2",
"husky": "^0.14.3",
"nyc": "^11.1.0",
"prettier": "^1.5.3",
"prettier": "^1.6.0",
"rimraf": "^2.6.1",
"semantic-release": "^8.0.0",
"sinon": "^3.2.1",
Expand Down
31 changes: 19 additions & 12 deletions test/format-commit.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,32 @@ test('Each type and aliases produce a commit with the input subject', t => {
subject: 'Commit subject',
};

Object.keys(types).concat(Object.keys(aliases)).forEach(type => {
t.is(parser.sync(formatCommit(Object.assign({}, {type}, input), {types, aliases}, config)).subject, input.subject);
});
Object.keys(types)
.concat(Object.keys(aliases))
.forEach(type => {
t.is(
parser.sync(formatCommit(Object.assign({}, {type}, input), {types, aliases}, config)).subject,
input.subject
);
});
});

test('Each type and aliases produce a commit with a subject ending with the appropriate emoji', t => {
const input = {
subject: 'Commit subject',
};

Object.keys(types).concat(Object.keys(aliases)).forEach(type => {
t.true(
parser
.sync(
formatCommit(Object.assign({}, {type}, input), {types, aliases}, Object.assign({}, config, {emoji: true}))
)
.subject.endsWith(aliases[type] ? aliases[type].emoji : types[type].emoji)
);
});
Object.keys(types)
.concat(Object.keys(aliases))
.forEach(type => {
t.true(
parser
.sync(
formatCommit(Object.assign({}, {type}, input), {types, aliases}, Object.assign({}, config, {emoji: true}))
)
.subject.endsWith(aliases[type] ? aliases[type].emoji : types[type].emoji)
);
});
});

test('Does not duplicate "BREAKING CHANGE" in commit message if it`s defined by user', t => {
Expand Down

0 comments on commit 91bbaf0

Please sign in to comment.