Skip to content

Commit

Permalink
Merge pull request #33 from Turbo87/duplicate-errors
Browse files Browse the repository at this point in the history
Fix duplicate error messages issue
  • Loading branch information
IanVS committed Feb 25, 2016
2 parents 905ff42 + 03472e5 commit 25a80e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function test(p, opts) {
) {
throw new Error(
chalk.red('Code did not pass lint rules') +
formatter(report.results)
// remove process.cwd() to convert absolute to relative paths
formatter(report.results).replace(process.cwd() + '/', '')
);
} else if (
warn &&
Expand Down
9 changes: 9 additions & 0 deletions tests/acceptance/acceptanceTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ describe('Acceptance: mocha-eslint', function () {
if (results[4].indexOf('1 failing') === -1) {
throw new Error('Did not get a failing test');
}

var reasonsCount = results[6].split('\n')
.filter(function(line) { return line.indexOf('Code did not pass lint rules') !== -1; })
.length;

if (reasonsCount !== 1) {
throw new Error('Counted ' + reasonsCount + " failure reasons");
}

done();
});
});
Expand Down

0 comments on commit 25a80e0

Please sign in to comment.