Skip to content

Commit

Permalink
fix(exclude): REALLY exclude listed commit types
Browse files Browse the repository at this point in the history
  • Loading branch information
tvardy committed Jun 13, 2017
1 parent 807e2e4 commit 9f83657
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ exports.getCommits = function (options) {
if (!commit) {
return false;
}
return options.exclude ? (options.exclude.indexOf(commit.type) !== -1) : true;
return options.exclude ? (options.exclude.indexOf(commit.type) === -1) : true;
});
};
4 changes: 4 additions & 0 deletions test/data/git/valid-commits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ feat(testing): did some testing
a2c164a718e45d7d3c5e37eec2008a3ebf371e93
feat(testing): did some testing

===END===
a2c164a718e45d7d3c5e37eec2008a3ebf371e94
feat(testing): did some more testing

===END===
9bbdcf32e1c46176c4cbdcef329ada45fed0bf5a
chore(release): 1.2.3
Expand Down
4 changes: 2 additions & 2 deletions test/git.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('git', function () {

return Git.getCommits()
.then(function (commits) {
Expect(commits).to.have.length(4);
Expect(commits).to.have.length(5);
Expect(commits[0]).to.have.property('type');
Expect(commits[0]).to.have.property('category');
Expect(commits[0]).to.have.property('subject');
Expand All @@ -90,7 +90,7 @@ describe('git', function () {

return Git.getCommits({ exclude: ['chore', 'style'] })
.then(function (commits) {
Expect(commits).to.have.length(2);
Expect(commits).to.have.length(3);
CP.execAsync.restore();
});
});
Expand Down

0 comments on commit 9f83657

Please sign in to comment.